diff --git a/ci/scripts/ci.sh b/ci/scripts/ci.sh index 0022fd28..cc60a333 100755 --- a/ci/scripts/ci.sh +++ b/ci/scripts/ci.sh @@ -25,7 +25,16 @@ src_dir=$PWD mkdir -p "$CI_DIR" cd "$CI_DIR" export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" -cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}" +cmake_args=("${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}") +if ! cmake "$src_dir" "${cmake_args[@]}"; then + # If cmake failed, try it again with debug options. + # Could add --trace / --trace-expand here too but they are very verbose. + cmake_args+=(--debug-find --debug-output --debug-trycompile --log-level=DEBUG) + cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?" + cat CMakeFiles/CMakeConfigureLog.yaml || true + find . -ls || true + false +fi if ver_ge "$cmake_ver" "3.15"; then cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" else