Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit afa93e0

Browse files
committed
CI: assert cmake version in run-build.sh for C++20 build
1 parent ced2876 commit afa93e0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

utils/docker/prepare-for-build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,12 @@ if [ "${CI_RUN}" == "YES" ]; then
9090
sudo_password chmod 0777 ${TEST_DIR}
9191
sudo_password mount -o size=2G -t tmpfs none ${TEST_DIR}
9292
fi || true
93+
94+
echo "CMake version:"
95+
cmake --version
96+
97+
# assign CMake's version to variable(s) - a single number representation for easier comparison
98+
CMAKE_VERSION=$(cmake --version | head -n1 | grep -P -o "\d+\.\d+")
99+
CMAKE_VERSION_MAJOR=$(echo ${CMAKE_VERSION} | cut -d. -f1)
100+
CMAKE_VERSION_MINOR=$(echo ${CMAKE_VERSION} | cut -d. -f2)
101+
CMAKE_VERSION_NUMBER=${CMAKE_VERSION_MAJOR}${CMAKE_VERSION_MINOR}

utils/docker/run-build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ function tests_gcc_release_cpp17_no_valgrind() {
214214
function tests_clang_release_cpp20_no_valgrind() {
215215
printf "\n$(tput setaf 1)$(tput setab 7)BUILD ${FUNCNAME[0]} START$(tput sgr 0)\n"
216216

217+
if [ ${CMAKE_VERSION_NUMBER} -lt 312 ]; then
218+
echo "ERROR: C++20 is supported in CMake since 3.12, installed version: ${CMAKE_VERSION}"
219+
exit 1
220+
fi
221+
217222
mkdir build && cd build
218223

219224
PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/opt/pmdk/lib/pkgconfig/ \

0 commit comments

Comments
 (0)