Skip to content

Commit 615e4c0

Browse files
authored
bumped minimum requirements to GCC 5.1 / Clang 3.5 / Visual Studio 2015 / CMake 3.5 (#5398)
The current versions only have partial C++11 support which fortunately has caused us only few issues so far but it would be good to finally have fully working C++11 support. This also gets rid of several CI builds on very outdated platforms. The outdated platforms were used to also test CMake 2.8 but as future versions of CMake will drop combability with CMake < 3.5 this is a good time to also drop that requirement on our part. This PR does not remove or update any outdated code.
1 parent f24c7fd commit 615e4c0

File tree

6 files changed

+29
-50
lines changed

6 files changed

+29
-50
lines changed

.github/workflows/CI-unixish-docker.yml

+5-30
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
strategy:
2121
matrix:
22-
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
22+
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
2323
include:
2424
- build_gui: false
2525
- image: "ubuntu:23.10"
@@ -39,13 +39,6 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v3
4141

42-
- name: Install missing software on CentOS 7
43-
if: matrix.image == 'centos:7'
44-
run: |
45-
yum install -y cmake gcc-c++ make pcre-devel
46-
yum --enablerepo=extras install -y epel-release
47-
yum install -y ccache
48-
4942
- name: Install missing software on ubuntu
5043
if: contains(matrix.image, 'ubuntu')
5144
run: |
@@ -62,30 +55,20 @@ jobs:
6255
# - it doesn't support centos
6356
- name: ccache
6457
uses: hendrikmuhs/[email protected]
65-
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
6658
with:
6759
key: ${{ github.workflow }}-${{ matrix.image }}
6860

69-
# tests require CMake 3.9 - no ccache available
70-
- name: CMake build (no tests / no ccache)
71-
if: matrix.image == 'ubuntu:14.04'
72-
run: |
73-
mkdir cmake.output
74-
cd cmake.output
75-
cmake -G "Unix Makefiles" -DHAVE_RULES=On ..
76-
cmake --build . -- -j$(nproc)
77-
7861
# tests require CMake 3.9 - ccache available
7962
- name: CMake build (no tests)
80-
if: matrix.image == 'centos:7' || matrix.image == 'ubuntu:16.04'
63+
if: matrix.image == 'ubuntu:16.04'
8164
run: |
8265
mkdir cmake.output
8366
cd cmake.output
8467
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
8568
cmake --build . -- -j$(nproc)
8669
8770
- name: CMake build
88-
if: ${{ !matrix.build_gui && matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04' }}
71+
if: ${{ !matrix.build_gui && matrix.image != 'ubuntu:16.04' }}
8972
run: |
9073
mkdir cmake.output
9174
cd cmake.output
@@ -99,15 +82,15 @@ jobs:
9982
cmake --build cmake.output -- -j$(nproc)
10083
10184
- name: Run CMake test
102-
if: matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04'
85+
if: matrix.image != 'ubuntu:16.04'
10386
run: |
10487
cmake --build cmake.output --target check -- -j$(nproc)
10588
10689
build_make:
10790

10891
strategy:
10992
matrix:
110-
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
93+
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
11194
fail-fast: false # Prefer quick result
11295

11396
runs-on: ubuntu-22.04
@@ -118,13 +101,6 @@ jobs:
118101
steps:
119102
- uses: actions/checkout@v3
120103

121-
- name: Install missing software on CentOS 7
122-
if: matrix.image == 'centos:7'
123-
run: |
124-
yum install -y gcc-c++ make which python3 pcre-devel
125-
yum --enablerepo=extras install -y epel-release
126-
yum install -y ccache
127-
128104
- name: Install missing software on ubuntu
129105
if: contains(matrix.image, 'ubuntu')
130106
run: |
@@ -136,7 +112,6 @@ jobs:
136112
# - it doesn't support centos
137113
- name: ccache
138114
uses: hendrikmuhs/[email protected]
139-
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
140115
with:
141116
key: ${{ github.workflow }}-${{ matrix.image }}
142117

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.12)
1+
cmake_minimum_required(VERSION 3.5)
22
project(Cppcheck)
33

44
include(cmake/cxx11.cmake)

cmake/compilerCheck.cmake

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
2-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
3-
message(ERROR "GCC >= 4.8 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
2+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
3+
message(ERROR "GCC >= 5.1 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
44
endif ()
55
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
6-
# TODO: verify this
7-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.9)
8-
message(ERROR "Clang >= 2.9 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
6+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
7+
message(ERROR "Clang >= 3.5 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
98
endif ()
109
elseif(MSVC)
11-
if (MSVC_VERSION VERSION_LESS 1800)
12-
message(ERROR "Visual Studio >= 2013 (1800) required - detected ${MSVC_VERSION} not supported")
10+
if (MSVC_VERSION VERSION_LESS 1900)
11+
message(ERROR "Visual Studio >= 2015 (19.0) required - detected ${MSVC_VERSION} not supported")
1312
endif ()
1413
endif()

readme.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,24 @@ You can stop the script whenever you like with Ctrl C.
2727

2828
## Compiling
2929

30-
Any C++11 compiler should work. For compilers with partial C++11 support it may work. If your compiler has the C++11 features that are available in Visual Studio 2013 / GCC 4.8 then it will work.
30+
Cppcheck requires a C++ compiler with (partial) C++11 support. Minimum required versions are GCC 5.1 / Clang 3.5 / Visual Studio 2015.
3131

32-
To build the GUI, you need Qt.
32+
To build the GUI application, you need to use the CMake or qmake (deprecated) build system.
3333

3434
When building the command line tool, [PCRE](http://www.pcre.org/) is optional. It is used if you build with rules.
3535

3636
There are multiple compilation choices:
37-
* qmake - cross platform build tool
38-
* cmake - cross platform build tool
39-
* Windows: Visual Studio (VS 2013 and above)
40-
* Windows: Qt Creator + mingw
41-
* gnu make
42-
* g++ 4.8 (or later)
43-
* clang++
44-
45-
### cmake
37+
* qmake - cross platform build tool (deprecated)
38+
* CMake - cross platform build tool
39+
* Windows: Visual Studio
40+
* Windows: Qt Creator + MinGW
41+
* GNU make
42+
* GCC (g++)
43+
* Clang (clang++)
44+
45+
### CMake
46+
47+
The minimum required version is CMake 3.5.
4648

4749
Example, compiling Cppcheck with cmake:
4850

releasenotes.txt

+2
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ Deprecations:
1717

1818
Other:
1919
- Added CMake option 'EXTERNALS_AS_SYSTEM' to treat external includes as 'SYSTEM' ones.
20+
- The minimum required compiler versions have been bumped to GCC 5.1 / Clang 3.5 / Visual Studio 2015
21+
- The minimum required CMake version has been bumped to 3.5

test/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ if (BUILD_TESTS)
6060
endif()
6161

6262
if (REGISTER_TESTS)
63-
# CMP0064 requires 3.4
63+
# CMP0057 requires 3.3 - if (IN_LIST)
64+
# CMP0064 requires 3.4 - if (TEST)
6465
# CMAKE_MATCH_<n> usage for if (MATCHES) requires 3.9
6566
cmake_minimum_required(VERSION 3.9)
6667
cmake_policy(SET CMP0064 NEW)

0 commit comments

Comments
 (0)