Merge pull request #3845 from pmatos/TESTJOBCOUNTFix

Use nproc only if TEST_JOB_COUNT not specified
This commit is contained in:
Tony Wasserka 2024-07-08 22:31:23 +02:00 committed by GitHub
commit 45011234d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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}")