mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
deps builld: Try to honour CMAKE_BUILD_PARALLEL_LEVEL (#13158)
* deps: Use CMAKE_BUILD_PARALLEL_LEVEL for dependency builds. If set when initial CMake is run, don't hard-code the number of CPUs for all the recursive child builds. * build_linux: Pass -j1 for dependency build. This is recommended by the comment at the top of deps/CMakeLists.txt, and makes sense as the recursive build steps will pick up CMAKE_BUILD_PARALLEL_LEVEL (otherwise the number of parallel jobs is squared).
This commit is contained in:
15
deps/CMakeLists.txt
vendored
15
deps/CMakeLists.txt
vendored
@@ -166,11 +166,18 @@ function(orcaslicer_add_cmake_project projectname)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(_gen "")
|
||||
set(_build_j "-j${NPROC}")
|
||||
if (MSVC)
|
||||
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
|
||||
set(_build_j "/m")
|
||||
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
|
||||
else()
|
||||
set(_gen "")
|
||||
endif()
|
||||
|
||||
if ($ENV{CMAKE_BUILD_PARALLEL_LEVEL})
|
||||
set(_build_j "") # assume environment will control --build parallel setting
|
||||
elseif(MSVC)
|
||||
set(_build_j "/m")
|
||||
else()
|
||||
set(_build_j "-j${NPROC}")
|
||||
endif ()
|
||||
|
||||
if (NOT IS_CROSS_COMPILE OR NOT APPLE)
|
||||
|
||||
Reference in New Issue
Block a user