Skip to content

Commit 324b01e

Browse files
committed
MDEV-36422 Build fails with cmake 4.0.0
Set policy_max version to 4.0 to avoid error Compatibility with CMake < 3.5 has been removed from CMake. Add github workflow to check CMake compatibility for commonly used versions and the newest ones.
1 parent cd07c34 commit 324b01e

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

.github/workflows/cmake.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CMake Compatibility Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-22.04
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
config:
15+
# Ubuntu 20.04
16+
- version: v3.16.3
17+
bintar: cmake-3.16.3-linux-x86_64.tar.gz
18+
# v3.17.5
19+
- version: v3.17.5
20+
bintar: cmake-3.17.5-linux-x86_64.tar.gz
21+
# Debian bullseye
22+
- version: v3.18.4
23+
bintar: cmake-3.18.4-linux-x86_64.tar.gz
24+
# v3.20.6
25+
- version: v3.20.6
26+
bintar: cmake-3.20.6-linux-x86_64.tar.gz
27+
# Ubuntu 22.04
28+
- version: v3.22.1
29+
bintar: cmake-3.22.1-linux-x86_64.tar.gz
30+
# Debian bookworm
31+
- version: v3.25.1
32+
bintar: cmake-3.25.1-linux-x86_64.tar.gz
33+
# Rockylinux 8, 9
34+
- version: v3.26.5
35+
bintar: cmake-3.26.5-linux-x86_64.tar.gz
36+
# Ubuntu 24.04
37+
- version: v3.28.3
38+
bintar: cmake-3.28.3-linux-x86_64.tar.gz
39+
# Latest v3 as of 2025-04-02
40+
- version: v3.31.6
41+
bintar: cmake-3.31.6-linux-x86_64.tar.gz
42+
# Latest v4 as of 2025-04-02
43+
- version: v4.0.0
44+
bintar: cmake-4.0.0-linux-x86_64.tar.gz
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v3
49+
with:
50+
submodules: "recursive"
51+
52+
- name: Update packages
53+
run: sudo apt update
54+
55+
- name: Download and Install CMake
56+
run: |
57+
wget https://github.com/Kitware/CMake/releases/download/${{ matrix.config.version }}/${{ matrix.config.bintar }}
58+
sudo tar xf ${{ matrix.config.bintar }} --strip-components=1 -C /usr/local
59+
cmake --version
60+
61+
- name: Install build dependencies
62+
run: sudo apt-get install -y libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
63+
64+
- name: Create Build Environment
65+
run: cmake -E make_directory ${{runner.workspace}}/build
66+
67+
- name: Configure CMake
68+
shell: bash
69+
run: |
70+
cmake --version
71+
cmake -B ${{runner.workspace}}/build -DCMAKE_BUILD_TYPE=RelWithDebInfo

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (C) 2021 Codership Oy <[email protected]>
33
#
44

5-
cmake_minimum_required (VERSION 2.8)
5+
cmake_minimum_required (VERSION 2.8...4.0)
66

77
# Parse version from version header file and store it into
88
# WSREP_LIB_VERSION.

0 commit comments

Comments
 (0)