File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ function getProjectModules(): array
202202 ],
203203 'FindPackageMessage ' => ['find_package_message ' ],
204204 'GenerateExportHeader ' => ['generate_export_header ' ],
205- 'ProcessorCount ' => ['processorcount ' ],
205+ 'ProcessorCount ' => ['ProcessorCount ' ],
206206 'PHP/AddCustomCommand ' => ['php_add_custom_command ' ],
207207 'PHP/Bison ' => ['php_bison ' , '/find_package\([\n ]*BISON/ ' ],
208208 'PHP/CheckAttribute ' => [
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ endif()
99enable_testing ()
1010
1111block()
12- include (ProcessorCount)
13- processorcount(processors )
12+ cmake_host_system_information (RESULT processors QUERY NUMBER_OF_LOGICAL_CORES)
1413
15- if (NOT processors EQUAL 0)
14+ set (parallel "" )
15+ if (processors )
1616 set (parallel -j${processors} )
1717 endif ()
1818
Original file line number Diff line number Diff line change @@ -30,8 +30,12 @@ endfunction()
3030block()
3131 _php_rebuild_get_all_targets(targets ${CMAKE_CURRENT_SOURCE_DIR} )
3232
33- include (ProcessorCount)
34- processorcount(processors )
33+ cmake_host_system_information (RESULT processors QUERY NUMBER_OF_LOGICAL_CORES)
34+
35+ set (parallel "" )
36+ if (processors )
37+ set (parallel --parallel ${processors} )
38+ endif ()
3539
3640 add_custom_command (
3741 OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/php_rebuild.timestamp
@@ -43,7 +47,7 @@ block()
4347 -E touch ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/php_rebuild.timestamp
4448 COMMAND
4549 ${CMAKE_COMMAND}
46- --build . --target php_rebuild -j ${processors }
50+ --build . --target php_rebuild ${parallel }
4751 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
4852 DEPENDS ${targets}
4953 )
You can’t perform that action at this time.
0 commit comments