More fine-tunable multithreading of deps

This commit is contained in:
tamasmeszaros 2023-08-10 15:50:07 +02:00
parent 23b01929f7
commit 22f32a046d
3 changed files with 10 additions and 5 deletions

View File

@ -14,9 +14,14 @@ endif ()
# The value of CMAKE_BUILD_TYPE will be used for building each dependency even if the
# generator is multi-config. Use this var to specify build type regardless of the generator.
function(add_cmake_project projectname)
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND;MAX_THREADS" "CMAKE_ARGS" ${ARGN})
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
set(_pcount ${DEP_${projectname}_MAX_THREADS})
if (NOT _pcount)
set(_pcount ${DEP_MAX_THREADS})
endif ()
set(_pcount ${P_ARGS_MAX_THREADS})
if (NOT _pcount)
ProcessorCount(_pcount)
endif ()

View File

@ -1,6 +1,4 @@
add_cmake_project(OCCT
MAX_THREADS 4 # Avoid extreme memory usage
#LMBBS: changed version to 7.6.2
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_2.zip
URL_HASH SHA256=c696b923593e8c18d059709717dbf155b3e72fdd283c8522047a790ec3a432c5

4
deps/CMakeLists.txt vendored
View File

@ -213,14 +213,16 @@ if (DEP_DEBUG AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
foreach (t ${_build_list})
list(APPEND _build_list_dbg ${t}_debug)
endforeach()
dep_message(STATUS "Building dep targets (Debug): ${_build_list_dbg}")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DebugBuild)
execute_process(
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=Debug -DDEP_DOWNLOAD_DIR=${DEP_DOWNLOAD_DIR} -DDESTDIR=${DESTDIR} -DDEP_MESSAGES_WRITTEN=ON
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DebugBuild
OUTPUT_QUIET
)
dep_message(STATUS "Building dep targets (Debug): ${_build_list_dbg}")
# Can be used to build only the debug libs
add_custom_target(deps_debug ALL)