summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/ctest_standalone.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-02 14:11:41 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-02 14:47:02 (GMT)
commit2a7ac62c04f2c4417306a505123a675baef82c8e (patch)
tree8fd3dcf3aed3e3f37f89a3a255fa897069b856dd /.gitlab/ci/ctest_standalone.cmake
parent1613d87dee2a6779a5c4b70bd1b06019e77e469d (diff)
downloadCMake-2a7ac62c04f2c4417306a505123a675baef82c8e.zip
CMake-2a7ac62c04f2c4417306a505123a675baef82c8e.tar.gz
CMake-2a7ac62c04f2c4417306a505123a675baef82c8e.tar.bz2
ci: Compute processor count earlier in ctest_standalone.cmake
Compute it early enough to use in the configure step.
Diffstat (limited to '.gitlab/ci/ctest_standalone.cmake')
-rw-r--r--.gitlab/ci/ctest_standalone.cmake16
1 files 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")