bumped minimum supported GCC version to 4.8 (#3768)

This commit is contained in:
Oliver Stöneberg 2022-02-05 17:57:32 +01:00 committed by GitHub
parent 47e9ed6e06
commit a15a227b73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 28 deletions

View File

@ -5,6 +5,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(GNUInstallDirs) include(GNUInstallDirs)
include(cmake/compilerCheck.cmake)
include(cmake/versions.cmake) include(cmake/versions.cmake)
include(cmake/options.cmake) include(cmake/options.cmake)
include(cmake/findDependencies.cmake) include(cmake/findDependencies.cmake)

View File

@ -112,19 +112,3 @@ int main(int argc, char* argv[])
#endif #endif
// *INDENT-ON* // *INDENT-ON*
} }
// Warn about deprecated compilers
#ifdef __clang__
# if (__clang_major__ < 2 || (__clang_major__ == 2 && __clang_minor__ < 9))
# warning "Using Clang 2.8 or earlier. Support for this version has been removed."
# endif
#elif defined(__GNUC__)
# if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6))
# warning "Using GCC 4.5 or earlier. Support for this version has been removed."
# endif
#elif defined(_MSC_VER)
# if (_MSC_VER < 1800)
# pragma message("WARNING: Using Visual Studio 2012 or earlier. Support for this version has been removed.")
# endif
#endif

14
cmake/compilerCheck.cmake Normal file
View File

@ -0,0 +1,14 @@
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(ERROR "GCC >= 4.8 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
endif ()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# TODO: verify this
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.9)
message(ERROR "Clang >= 2.9 required - detected ${CMAKE_CXX_COMPILER_VERSION} not supported")
endif ()
elseif(MSVC)
if (MSVC_VERSION VERSION_LESS 1800)
message(ERROR "Visual Studio >= 2013 (1800) required - detected ${MSVC_VERSION} not supported")
endif ()
endif()

View File

@ -46,10 +46,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"
endif() endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
message(FATAL_ERROR "${PROJECT_NAME} c++11 support requires g++ 4.6 or greater, but it is ${CMAKE_CXX_COMPILER_VERSION}")
endif ()
add_compile_options(-Woverloaded-virtual) # when a function declaration hides virtual functions from a base class add_compile_options(-Woverloaded-virtual) # when a function declaration hides virtual functions from a base class
add_compile_options(-Wno-maybe-uninitialized) # there are some false positives add_compile_options(-Wno-maybe-uninitialized) # there are some false positives
add_compile_options(-Wsuggest-attribute=noreturn) add_compile_options(-Wsuggest-attribute=noreturn)

View File

@ -56,9 +56,9 @@ This is not just a tool for mainstream gcc/msvc c/c++ developers. If you can com
## C++ language ## C++ language
Our goal is to be highly portable. Users must be able to compile Cppcheck with GCC 4.6 or MSVS 2013. Our goal is to be highly portable. Users must be able to compile Cppcheck with GCC 4.8 or Visual Studio 2013.
No C++14 is allowed. A subset of the C++11 is allowed. No C++14 is allowed. A subset of C++11 is allowed.
## Avoid dependencies ## Avoid dependencies

View File

@ -27,7 +27,7 @@ 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.6 then it will work. 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.
To build the GUI, you need Qt. To build the GUI, you need Qt.
@ -39,7 +39,7 @@ There are multiple compilation choices:
* Windows: Visual Studio (VS 2013 and above) * Windows: Visual Studio (VS 2013 and above)
* Windows: Qt Creator + mingw * Windows: Qt Creator + mingw
* gnu make * gnu make
* g++ 4.6 (or later) * g++ 4.8 (or later)
* clang++ * clang++
### cmake ### cmake

View File

@ -15,7 +15,7 @@ Manual
Compiling Compiling
Any C++11 compiler should work. For compilers with partial C++11 support it may work. If 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.6 your compiler has the C++11 features that are available in Visual Studio 2013 / GCC 4.8
then it will work. then it will work.
To build the GUI, you need Qt. To build the GUI, you need Qt.
@ -36,7 +36,7 @@ Compiling
* Windows: Visual Studio * Windows: Visual Studio
* Windows: Qt Creator + mingw * Windows: Qt Creator + mingw
* gnu make * gnu make
* g++ 4.6 (or later) * g++ 4.8 (or later)
* clang++ * clang++
cmake cmake

View File

@ -16,7 +16,7 @@
## ビルド ## ビルド
C++11に対応したコンパイラが利用できます。部分的にC++11にサポートしたコンパイラも利用できるかもしれません。もし、あなたのコンパイラがVisual Studio 2013や GCC 4.6で利用できるC++11機能がサポートされているなら、そのコンパイラが利用できます。 C++11に対応したコンパイラが利用できます。部分的にC++11にサポートしたコンパイラも利用できるかもしれません。もし、あなたのコンパイラがVisual Studio 2013や GCC 4.8で利用できるC++11機能がサポートされているなら、そのコンパイラが利用できます。
GUIも利用する場合、Qtライブラリが必要です。 GUIも利用する場合、Qtライブラリが必要です。
@ -28,7 +28,7 @@ GUIも利用する場合、Qtライブラリが必要です。
* Windows: Visual Studio (VS 2013 またはそれ以上) * Windows: Visual Studio (VS 2013 またはそれ以上)
* Windows: Qt Creator + mingw * Windows: Qt Creator + mingw
* gnu make * gnu make
* g++ 4.6 (またはそれ以上) * g++ 4.8 (またはそれ以上)
* clang++ * clang++
### cmake ### cmake