From eac91e08f477f7e70601707530d8db822dbc74e3 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 10 Sep 2025 07:06:21 -0400 Subject: [PATCH] ci: add cmake --parallel build option Drop nproc call and inconsistent -j setting. --- ci/configs/sanitize.bash | 2 +- ci/scripts/ci.sh | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ci/configs/sanitize.bash b/ci/configs/sanitize.bash index e582dc5d..907f3295 100644 --- a/ci/configs/sanitize.bash +++ b/ci/configs/sanitize.bash @@ -4,5 +4,5 @@ NIX_ARGS=(--arg enableLibcxx true --argstr libcxxSanitizers "Thread" --argstr ca export CXX=clang++ export CXXFLAGS="-ggdb -Werror -Wall -Wextra -Wpedantic -Wthread-safety -Wno-unused-parameter -fsanitize=thread -Wno-c++23-lambda-attributes" CMAKE_ARGS=() -BUILD_ARGS=(-k -j4) +BUILD_ARGS=(-k) BUILD_TARGETS=(mptest) diff --git a/ci/scripts/ci.sh b/ci/scripts/ci.sh index 0022fd28..adbc6ab1 100755 --- a/ci/scripts/ci.sh +++ b/ci/scripts/ci.sh @@ -24,15 +24,14 @@ ver_ge() { [ "$(printf '%s\n' "$2" "$1" | sort -V | head -n1)" = "$2" ]; } src_dir=$PWD mkdir -p "$CI_DIR" cd "$CI_DIR" -export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}" if ver_ge "$cmake_ver" "3.15"; then - cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" + cmake --build . --parallel -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" else # Older versions of cmake can only build one target at a time with --target, # and do not support -t shortcut for t in "${BUILD_TARGETS[@]}"; do - cmake --build . --target "$t" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" + cmake --build . --parallel --target "$t" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" done fi ctest --output-on-failure