mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +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:
@@ -517,7 +517,7 @@ if [[ -n "${BUILD_DEPS}" ]] ; then
|
||||
fi
|
||||
|
||||
print_and_run cmake -S deps -B deps/$BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" -G Ninja "${COLORED_OUTPUT}" "${BUILD_ARGS[@]}"
|
||||
print_and_run cmake --build deps/$BUILD_DIR
|
||||
print_and_run cmake --build deps/$BUILD_DIR -j1
|
||||
fi
|
||||
|
||||
if [[ -n "${BUILD_ORCA}" ]] || [[ -n "${BUILD_TESTS}" ]] ; then
|
||||
|
||||
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