-
Notifications
You must be signed in to change notification settings - Fork 35
cmake: Increase cmake policy version #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
0ffdb14
6ba1050
9441e5a
e416d45
1c2958b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CI_DESC="CI job using newest Cap'n Proto and cmake versions" | ||
CI_DIR=build-newdeps | ||
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds" | ||
CAPNP_CHECKOUT=master | ||
# cmakeVersion here should match policy version in CMakeLists.txt | ||
NIX_ARGS=(--argstr capnprotoVersion "none" --argstr cmakeVersion "4.1.1") | ||
BUILD_ARGS=(-k) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
CI_DESC="CI job using old Cap'n Proto and cmake versions" | ||
CI_DIR=build-olddeps | ||
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds" | ||
# cmakeVersion here should match minimum version in CMakeLists.txt | ||
NIX_ARGS=(--argstr capnprotoVersion "0.7.1" --argstr cmakeVersion "3.12.4") | ||
BUILD_ARGS=(-k) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,17 +21,43 @@ cmake --version | |
cmake_ver=$(cmake --version | awk '/version/{print $3; exit}') | ||
ver_ge() { [ "$(printf '%s\n' "$2" "$1" | sort -V | head -n1)" = "$2" ]; } | ||
|
||
# If CAPNP_CHECKOUT was requested, clone and install requested Cap'n Proto branch or tag | ||
capnp_prefix= | ||
if [ -n "${CAPNP_CHECKOUT-}" ]; then | ||
capnp_prefix="$PWD/capnp-install" | ||
[ -e "capnp" ] || git clone -b "${CAPNP_CHECKOUT}" "https://github.com/capnproto/capnproto" capnp | ||
mkdir -p capnp/build | ||
( | ||
cd capnp/build | ||
git --no-pager log -1 || true | ||
CXXFLAGS="-std=c++20" cmake .. "-DCMAKE_INSTALL_PREFIX=${capnp_prefix}" -DBUILD_TESTING=OFF -DWITH_OPENSSL=OFF -DWITH_ZLIB=OFF | ||
cmake --build . | ||
cmake --install . | ||
) | ||
export CMAKE_PREFIX_PATH="${capnp_prefix}:${CMAKE_PREFIX_PATH-}" | ||
fi | ||
|
||
src_dir=$PWD | ||
mkdir -p "$CI_DIR" | ||
cd "$CI_DIR" | ||
cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}" | ||
git --no-pager log -1 || true | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This log file name has been used only since CMake 3.26. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re: #209 (comment)
Yes that's part of the reason for adding |
||
find . -ls || true | ||
false | ||
fi | ||
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[@]}"}" | ||
Comment on lines
+55
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the
This means that the build will be efficiently parallelized with the "Ninja" generator, but not with the "Unix Makefiles" generator. However, not all scripts in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re: #209 (comment)
On my system I see it passing |
||
done | ||
fi | ||
ctest --output-on-failure |
Uh oh!
There was an error while loading. Please reload this page.