Skip to content

Commit 09150ed

Browse files
authored
fixed #14259/#14491 - CI-unixish.yml: added step using minimum required CMake version / bumped minimum CMake version to 3.22 (#8210)
1 parent fdc0170 commit 09150ed

File tree

6 files changed

+85
-10
lines changed

6 files changed

+85
-10
lines changed

.github/workflows/CI-unixish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,42 @@ jobs:
407407
run: |
408408
cmake --build cmake.output.boost -- -j$(nproc)
409409
410+
build_cmake_minimum: # TODO: move to docker workflow?
411+
412+
runs-on: ubuntu-22.04 # use the oldest available runner
413+
414+
env:
415+
CMAKE_VERSION: 3.22
416+
CMAKE_VERSION_FULL: 3.22.6
417+
418+
steps:
419+
- uses: actions/checkout@v4
420+
with:
421+
persist-credentials: false
422+
423+
- name: Install missing software
424+
run: |
425+
sudo apt-get update
426+
sudo apt-get install libxml2-utils
427+
# qt6-tools-dev-tools for lprodump
428+
# qt6-l10n-tools for lupdate
429+
sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev
430+
431+
- name: Install CMake
432+
run: |
433+
wget https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64.tar.gz
434+
tar xf cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64.tar.gz
435+
436+
- name: Run CMake (without GUI)
437+
run: |
438+
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
439+
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On
440+
441+
- name: Run CMake (with GUI)
442+
run: |
443+
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
444+
cmake -S . -B cmake.output.gui -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On
445+
410446
build:
411447

412448
strategy:

.github/workflows/CI-windows.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,48 @@ jobs:
9898
run: |
9999
cmake --build build.cxxstd --config Debug || exit /b !errorlevel!
100100
101+
build_cmake_minimum:
102+
103+
runs-on: windows-2022 # use the oldest available runner
104+
105+
env:
106+
CMAKE_VERSION: 3.22
107+
CMAKE_VERSION_FULL: 3.22.6
108+
109+
steps:
110+
- uses: actions/checkout@v4
111+
with:
112+
persist-credentials: false
113+
114+
- name: Install CMake
115+
run: |
116+
curl -fsSL https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64.zip -o cmake.zip || exit /b !errorlevel!
117+
7z x cmake.zip || exit /b !errorlevel!
118+
119+
- name: Set up Visual Studio environment
120+
uses: ilammy/msvc-dev-cmd@v1
121+
with:
122+
arch: x64
123+
124+
- name: Install Qt
125+
uses: jurplel/install-qt-action@v4
126+
with:
127+
version: 6.10.0
128+
modules: 'qtcharts'
129+
setup-python: 'false'
130+
cache: true
131+
aqtversion: '==3.1.*' # TODO: remove when aqtinstall 3.2.2 is available
132+
133+
- name: Run CMake (without GUI)
134+
run: |
135+
:: TODO: enable DHAVE_RULES?
136+
cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64\bin\cmake.exe -S . -B cmake.output -G "Visual Studio 17 2022" -A x64 -DHAVE_RULES=Off -DBUILD_TESTING=On
137+
138+
- name: Run CMake (with GUI)
139+
run: |
140+
:: TODO: enable DHAVE_RULES?
141+
cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64\bin\cmake.exe -S . -B cmake.output.gui -G "Visual Studio 17 2022" -A x64 -DHAVE_RULES=Off -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On
142+
101143
build:
102144
strategy:
103145
matrix:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.22)
22
project(Cppcheck VERSION 2.18.99 LANGUAGES CXX)
33

44
include(cmake/options.cmake)

cmake/options.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,10 @@ option(ENABLE_CSA_ALPHA "Enable Clang Static Analyzer alpha checkers for run
124124
# TODO: disable by default like make build?
125125
option(FILESDIR "Hard-coded directory for files to load from" OFF)
126126

127-
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16")
128-
set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
129-
# need to disable the prologue or it will be treated like a system header and not emit any warnings
130-
# see https://gitlab.kitware.com/cmake/cmake/-/issues/21219
131-
set(CMAKE_PCH_PROLOGUE "")
132-
else()
133-
set(CMAKE_DISABLE_PRECOMPILE_HEADERS On CACHE BOOL "Disable precompiled headers")
134-
endif()
127+
set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
128+
# need to disable the prologue or it will be treated like a system header and not emit any warnings
129+
# see https://gitlab.kitware.com/cmake/cmake/-/issues/21219
130+
set(CMAKE_PCH_PROLOGUE "")
135131

136132
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Output directory for headers")
137133
set(CMAKE_LIB_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "Output directory for libraries")

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The minimum required Python version is 3.7.
5252
5353
### CMake
5454
55-
The minimum required version is CMake 3.13.
55+
The minimum required version is CMake 3.22.
5656
5757
Example, compiling Cppcheck with cmake:
5858

releasenotes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ Infrastructure & dependencies:
2323

2424
Other:
2525
- The built-in "win*" and "unix*" platforms will now default to signed char type instead of unknown signedness. If you require unsigned chars please specify "--funsigned-char"
26+
- bumped minimum required CMake version to 3.22
2627
-

0 commit comments

Comments
 (0)