From 2a7ac62c04f2c4417306a505123a675baef82c8e Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Mar 2022 09:11:41 -0500 Subject: ci: Compute processor count earlier in ctest_standalone.cmake Compute it early enough to use in the configure step. --- .gitlab/ci/ctest_standalone.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab/ci/ctest_standalone.cmake b/.gitlab/ci/ctest_standalone.cmake index 48e910b..cec2de2 100644 --- a/.gitlab/ci/ctest_standalone.cmake +++ b/.gitlab/ci/ctest_standalone.cmake @@ -6,6 +6,14 @@ include("${CMAKE_CURRENT_LIST_DIR}/env_$ENV{CMAKE_CONFIGURATION}.cmake" OPTIONAL set(cmake_args -C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake") +include(ProcessorCount) +ProcessorCount(nproc) +if (NOT "$ENV{CTEST_MAX_PARALLELISM}" STREQUAL "") + if (nproc GREATER "$ENV{CTEST_MAX_PARALLELISM}") + set(nproc "$ENV{CTEST_MAX_PARALLELISM}") + endif () +endif () + # Create an entry in CDash. ctest_start("${ctest_model}" GROUP "${ctest_group}") @@ -33,14 +41,6 @@ if (configure_result) "Failed to configure") endif () -include(ProcessorCount) -ProcessorCount(nproc) -if (NOT "$ENV{CTEST_MAX_PARALLELISM}" STREQUAL "") - if (nproc GREATER "$ENV{CTEST_MAX_PARALLELISM}") - set(nproc "$ENV{CTEST_MAX_PARALLELISM}") - endif () -endif () - if (CTEST_CMAKE_GENERATOR STREQUAL "Unix Makefiles") set(CTEST_BUILD_FLAGS "-j${nproc} -l${nproc}") elseif (CTEST_CMAKE_GENERATOR MATCHES "Ninja") -- cgit v0.12