Skip to content

Commit c0fb404

Browse files
committed
fixed #14491 - bumped minimum CMake version to 3.22
1 parent 0cf439b commit c0fb404

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

.github/workflows/CI-unixish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
runs-on: ubuntu-22.04
2222

2323
env:
24-
CMAKE_VERSION: 3.13
25-
CMAKE_VERSION_FULL: 3.13.5
24+
CMAKE_VERSION: 3.22
25+
CMAKE_VERSION_FULL: 3.22.6
2626

2727
steps:
2828
- uses: actions/checkout@v4
@@ -39,15 +39,15 @@ jobs:
3939
4040
- name: Install CMake
4141
run: |
42-
wget https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-Linux-x86_64.tar.gz
43-
tar xf cmake-${{ env.CMAKE_VERSION_FULL }}-Linux-x86_64.tar.gz
42+
wget https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64.tar.gz
43+
tar xf cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64.tar.gz
4444
4545
- name: Run CMake on ubuntu (without GUI)
4646
run: |
47-
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-Linux-x86_64/bin:$PATH
47+
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
4848
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On
4949
5050
- name: Run CMake on ubuntu (with GUI)
5151
run: |
52-
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-Linux-x86_64/bin:$PATH
52+
export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH
5353
cmake -S . -B cmake.output.gui -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On

.github/workflows/CI-windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
runs-on: windows-2022
2727

2828
env:
29-
CMAKE_VERSION: 3.13
30-
CMAKE_VERSION_FULL: 3.13.5
29+
CMAKE_VERSION: 3.22
30+
CMAKE_VERSION_FULL: 3.22.6
3131

3232
steps:
3333
- uses: actions/checkout@v4
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Install CMake
3838
run: |
39-
curl -fsSL https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-win64-x64.zip -o cmake.zip || exit /b !errorlevel!
39+
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!
4040
7z x cmake.zip || exit /b !errorlevel!
4141
4242
- name: Set up Visual Studio environment
@@ -56,9 +56,9 @@ jobs:
5656
- name: Run CMake on ubuntu (without GUI)
5757
run: |
5858
:: TODO: enable DHAVE_RULES?
59-
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_TESTS=On
59+
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_TESTS=On
6060
6161
- name: Run CMake on ubuntu (with GUI)
6262
run: |
6363
:: TODO: enable DHAVE_RULES?
64-
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_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On
64+
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_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On

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.13)
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
@@ -113,14 +113,10 @@ option(ENABLE_CSA_ALPHA "Enable Clang Static Analyzer alpha checkers for run
113113
# TODO: disable by default like make build?
114114
option(FILESDIR "Hard-coded directory for files to load from" OFF)
115115

116-
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16")
117-
set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
118-
# need to disable the prologue or it will be treated like a system header and not emit any warnings
119-
# see https://gitlab.kitware.com/cmake/cmake/-/issues/21219
120-
set(CMAKE_PCH_PROLOGUE "")
121-
else()
122-
set(CMAKE_DISABLE_PRECOMPILE_HEADERS On CACHE BOOL "Disable precompiled headers")
123-
endif()
116+
set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
117+
# need to disable the prologue or it will be treated like a system header and not emit any warnings
118+
# see https://gitlab.kitware.com/cmake/cmake/-/issues/21219
119+
set(CMAKE_PCH_PROLOGUE "")
124120

125121
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Output directory for headers")
126122
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
@@ -22,4 +22,5 @@ Infrastructure & dependencies:
2222

2323
Other:
2424
- 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"
25+
- bumped minimum required CMake version to 3.22
2526
-

0 commit comments

Comments
 (0)