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.
This commit is contained in:
parent
f24c7fdae9
commit
615e4c01c4
|
@ -19,7 +19,7 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
|
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
|
||||||
include:
|
include:
|
||||||
- build_gui: false
|
- build_gui: false
|
||||||
- image: "ubuntu:23.10"
|
- image: "ubuntu:23.10"
|
||||||
|
@ -39,13 +39,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install missing software on CentOS 7
|
|
||||||
if: matrix.image == 'centos:7'
|
|
||||||
run: |
|
|
||||||
yum install -y cmake gcc-c++ make pcre-devel
|
|
||||||
yum --enablerepo=extras install -y epel-release
|
|
||||||
yum install -y ccache
|
|
||||||
|
|
||||||
- name: Install missing software on ubuntu
|
- name: Install missing software on ubuntu
|
||||||
if: contains(matrix.image, 'ubuntu')
|
if: contains(matrix.image, 'ubuntu')
|
||||||
run: |
|
run: |
|
||||||
|
@ -62,22 +55,12 @@ jobs:
|
||||||
# - it doesn't support centos
|
# - it doesn't support centos
|
||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
|
|
||||||
with:
|
with:
|
||||||
key: ${{ github.workflow }}-${{ matrix.image }}
|
key: ${{ github.workflow }}-${{ matrix.image }}
|
||||||
|
|
||||||
# tests require CMake 3.9 - no ccache available
|
|
||||||
- name: CMake build (no tests / no ccache)
|
|
||||||
if: matrix.image == 'ubuntu:14.04'
|
|
||||||
run: |
|
|
||||||
mkdir cmake.output
|
|
||||||
cd cmake.output
|
|
||||||
cmake -G "Unix Makefiles" -DHAVE_RULES=On ..
|
|
||||||
cmake --build . -- -j$(nproc)
|
|
||||||
|
|
||||||
# tests require CMake 3.9 - ccache available
|
# tests require CMake 3.9 - ccache available
|
||||||
- name: CMake build (no tests)
|
- name: CMake build (no tests)
|
||||||
if: matrix.image == 'centos:7' || matrix.image == 'ubuntu:16.04'
|
if: matrix.image == 'ubuntu:16.04'
|
||||||
run: |
|
run: |
|
||||||
mkdir cmake.output
|
mkdir cmake.output
|
||||||
cd cmake.output
|
cd cmake.output
|
||||||
|
@ -85,7 +68,7 @@ jobs:
|
||||||
cmake --build . -- -j$(nproc)
|
cmake --build . -- -j$(nproc)
|
||||||
|
|
||||||
- name: CMake build
|
- name: CMake build
|
||||||
if: ${{ !matrix.build_gui && matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04' }}
|
if: ${{ !matrix.build_gui && matrix.image != 'ubuntu:16.04' }}
|
||||||
run: |
|
run: |
|
||||||
mkdir cmake.output
|
mkdir cmake.output
|
||||||
cd cmake.output
|
cd cmake.output
|
||||||
|
@ -99,7 +82,7 @@ jobs:
|
||||||
cmake --build cmake.output -- -j$(nproc)
|
cmake --build cmake.output -- -j$(nproc)
|
||||||
|
|
||||||
- name: Run CMake test
|
- name: Run CMake test
|
||||||
if: matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04'
|
if: matrix.image != 'ubuntu:16.04'
|
||||||
run: |
|
run: |
|
||||||
cmake --build cmake.output --target check -- -j$(nproc)
|
cmake --build cmake.output --target check -- -j$(nproc)
|
||||||
|
|
||||||
|
@ -107,7 +90,7 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
|
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.10"]
|
||||||
fail-fast: false # Prefer quick result
|
fail-fast: false # Prefer quick result
|
||||||
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
@ -118,13 +101,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install missing software on CentOS 7
|
|
||||||
if: matrix.image == 'centos:7'
|
|
||||||
run: |
|
|
||||||
yum install -y gcc-c++ make which python3 pcre-devel
|
|
||||||
yum --enablerepo=extras install -y epel-release
|
|
||||||
yum install -y ccache
|
|
||||||
|
|
||||||
- name: Install missing software on ubuntu
|
- name: Install missing software on ubuntu
|
||||||
if: contains(matrix.image, 'ubuntu')
|
if: contains(matrix.image, 'ubuntu')
|
||||||
run: |
|
run: |
|
||||||
|
@ -136,7 +112,6 @@ jobs:
|
||||||
# - it doesn't support centos
|
# - it doesn't support centos
|
||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
|
|
||||||
with:
|
with:
|
||||||
key: ${{ github.workflow }}-${{ matrix.image }}
|
key: ${{ github.workflow }}-${{ matrix.image }}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
project(Cppcheck)
|
project(Cppcheck)
|
||||||
|
|
||||||
include(cmake/cxx11.cmake)
|
include(cmake/cxx11.cmake)
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
|
||||||
message(ERROR "GCC >= 4.8 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
|
message(ERROR "GCC >= 5.1 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
|
||||||
endif ()
|
endif ()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
# TODO: verify this
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.9)
|
message(ERROR "Clang >= 3.5 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
|
||||||
message(ERROR "Clang >= 2.9 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
|
|
||||||
endif ()
|
endif ()
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
if (MSVC_VERSION VERSION_LESS 1800)
|
if (MSVC_VERSION VERSION_LESS 1900)
|
||||||
message(ERROR "Visual Studio >= 2013 (1800) required - detected ${MSVC_VERSION} not supported")
|
message(ERROR "Visual Studio >= 2015 (19.0) required - detected ${MSVC_VERSION} not supported")
|
||||||
endif ()
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
22
readme.md
22
readme.md
|
@ -27,22 +27,24 @@ You can stop the script whenever you like with Ctrl C.
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
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.
|
Cppcheck requires a C++ compiler with (partial) C++11 support. Minimum required versions are GCC 5.1 / Clang 3.5 / Visual Studio 2015.
|
||||||
|
|
||||||
To build the GUI, you need Qt.
|
To build the GUI application, you need to use the CMake or qmake (deprecated) build system.
|
||||||
|
|
||||||
When building the command line tool, [PCRE](http://www.pcre.org/) is optional. It is used if you build with rules.
|
When building the command line tool, [PCRE](http://www.pcre.org/) is optional. It is used if you build with rules.
|
||||||
|
|
||||||
There are multiple compilation choices:
|
There are multiple compilation choices:
|
||||||
* qmake - cross platform build tool
|
* qmake - cross platform build tool (deprecated)
|
||||||
* cmake - cross platform build tool
|
* CMake - cross platform build tool
|
||||||
* Windows: Visual Studio (VS 2013 and above)
|
* Windows: Visual Studio
|
||||||
* Windows: Qt Creator + mingw
|
* Windows: Qt Creator + MinGW
|
||||||
* gnu make
|
* GNU make
|
||||||
* g++ 4.8 (or later)
|
* GCC (g++)
|
||||||
* clang++
|
* Clang (clang++)
|
||||||
|
|
||||||
### cmake
|
### CMake
|
||||||
|
|
||||||
|
The minimum required version is CMake 3.5.
|
||||||
|
|
||||||
Example, compiling Cppcheck with cmake:
|
Example, compiling Cppcheck with cmake:
|
||||||
|
|
||||||
|
|
|
@ -17,3 +17,5 @@ Deprecations:
|
||||||
|
|
||||||
Other:
|
Other:
|
||||||
- Added CMake option 'EXTERNALS_AS_SYSTEM' to treat external includes as 'SYSTEM' ones.
|
- Added CMake option 'EXTERNALS_AS_SYSTEM' to treat external includes as 'SYSTEM' ones.
|
||||||
|
- The minimum required compiler versions have been bumped to GCC 5.1 / Clang 3.5 / Visual Studio 2015
|
||||||
|
- The minimum required CMake version has been bumped to 3.5
|
||||||
|
|
|
@ -60,7 +60,8 @@ if (BUILD_TESTS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (REGISTER_TESTS)
|
if (REGISTER_TESTS)
|
||||||
# CMP0064 requires 3.4
|
# CMP0057 requires 3.3 - if (IN_LIST)
|
||||||
|
# CMP0064 requires 3.4 - if (TEST)
|
||||||
# CMAKE_MATCH_<n> usage for if (MATCHES) requires 3.9
|
# CMAKE_MATCH_<n> usage for if (MATCHES) requires 3.9
|
||||||
cmake_minimum_required(VERSION 3.9)
|
cmake_minimum_required(VERSION 3.9)
|
||||||
cmake_policy(SET CMP0064 NEW)
|
cmake_policy(SET CMP0064 NEW)
|
||||||
|
|
Loading…
Reference in New Issue