Skip to content

Commit 6a66de0

Browse files
committed
fixed #14491 - bumped minimum CMake version to 3.22
1 parent c4642f1 commit 6a66de0

6 files changed

Lines changed: 18 additions & 21 deletions

File tree

.github/workflows/CI-unixish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ jobs:
412412
runs-on: ubuntu-22.04
413413

414414
env:
415-
CMAKE_VERSION: 3.13
416-
CMAKE_VERSION_FULL: 3.13.5
415+
CMAKE_VERSION: 3.22
416+
CMAKE_VERSION_FULL: 3.22.6
417417

418418
steps:
419419
- uses: actions/checkout@v4
@@ -430,17 +430,17 @@ jobs:
430430
431431
- name: Install CMake
432432
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
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
435435
436436
- name: Run CMake on ubuntu (without GUI)
437437
run: |
438-
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-Linux-x86_64/bin:$PATH
438+
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
439439
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On
440440
441441
- name: Run CMake on ubuntu (with GUI)
442442
run: |
443-
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-Linux-x86_64/bin:$PATH
443+
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
444444
cmake -S . -B cmake.output.gui -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On
445445
446446
build:

.github/workflows/CI-windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ jobs:
103103
runs-on: windows-2022
104104

105105
env:
106-
CMAKE_VERSION: 3.13
107-
CMAKE_VERSION_FULL: 3.13.5
106+
CMAKE_VERSION: 3.22
107+
CMAKE_VERSION_FULL: 3.22.6
108108

109109
steps:
110110
- uses: actions/checkout@v4
@@ -113,7 +113,7 @@ jobs:
113113

114114
- name: Install CMake
115115
run: |
116-
curl -fsSL https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-win64-x64.zip -o cmake.zip || exit /b !errorlevel!
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!
117117
7z x cmake.zip || exit /b !errorlevel!
118118
119119
- name: Set up Visual Studio environment
@@ -133,12 +133,12 @@ jobs:
133133
- name: Run CMake on ubuntu (without GUI)
134134
run: |
135135
:: TODO: enable DHAVE_RULES?
136-
cmake-${{ env.CMAKE_VERSION_FULL }}-win64-x64\bin\cmake.exe -S . -B cmake.output -G "Visual Studio 17 2022" -A x64 -DHAVE_RULES=Off -DBUILD_TESTING=On
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
137137
138138
- name: Run CMake on ubuntu (with GUI)
139139
run: |
140140
:: TODO: enable DHAVE_RULES?
141-
cmake-${{ env.CMAKE_VERSION_FULL }}-win64-x64\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
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
142142
143143
build:
144144
strategy:

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)