From 24017f379e5b7daf3a958ed59b86121daffc3154 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Mon, 8 Jul 2024 21:38:56 +0200 Subject: [PATCH] Use nproc only if TEST_JOB_COUNT not specified --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 710c75833..2b1580d14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}")