Skip to content

Commit e6fd980

Browse files
committed
ci: add cmake debug output and --parallel build option
1 parent 94439b2 commit e6fd980

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ci/scripts/ci.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ src_dir=$PWD
4141
mkdir -p "$CI_DIR"
4242
cd "$CI_DIR"
4343
git --no-pager log -1 || true
44-
cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}"
44+
cmake_args=("${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}")
45+
if ! cmake "$src_dir" "${cmake_args[@]}"; then
46+
# If cmake failed, try it again with debug options.
47+
# Could add --trace / --trace-expand here too for more information but these are very verbose.
48+
cmake_args+=(--debug-find --debug-trycompile --log-level=DEBUG)
49+
cmake "$src_dir" "${cmake_args[@]}"
50+
fi
4551
if ver_ge "$cmake_ver" "3.15"; then
46-
cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
52+
cmake --build . --parallel -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
4753
else
4854
# Older versions of cmake can only build one target at a time with --target,
4955
# and do not support -t shortcut
5056
for t in "${BUILD_TARGETS[@]}"; do
51-
cmake --build . --target "$t" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
57+
cmake --build . --parallel --target "$t" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
5258
done
5359
fi
5460
ctest --output-on-failure

0 commit comments

Comments
 (0)