Use nproc only if TEST_JOB_COUNT not specified

This commit is contained in:
Paulo Matos 2024-07-08 21:38:56 +02:00
parent 95a9f32bf0
commit 24017f379e

View File

@ -373,8 +373,7 @@ if (BUILD_TESTS)
set (TEST_JOB_COUNT "" CACHE STRING "Override number of parallel jobs to use while running tests")
if (TEST_JOB_COUNT)
message(STATUS "Running tests with ${TEST_JOB_COUNT} jobs")
endif()
if (CMAKE_VERSION VERSION_LESS "3.29")
elseif(CMAKE_VERSION VERSION_LESS "3.29")
execute_process(COMMAND "nproc" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE TEST_JOB_COUNT)
endif()
set(TEST_JOB_FLAG "-j${TEST_JOB_COUNT}")