From 4235bb4ce38f8aed9ac6d5c1c92e8792dff1698e Mon Sep 17 00:00:00 2001 From: Username404 <w.iron.zombie@gmail.com> Date: Tue, 16 Mar 2021 16:42:28 +0100 Subject: [PATCH] Add a CMake warning for (mostly) old compilers. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17aa013..039e135 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,9 @@ endif() set(CMAKE_CXX_FLAGS_RELEASE "-Os") if((${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) OR (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0) + message(WARNING "A ${CMAKE_CXX_COMPILER_ID} compiler version of preferably 11 or higher should be used.") + endif() set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc") set(CMAKE_CXX_FLAGS "-flto ${CMAKE_CXX_FLAGS} -fpie -pipe -fstack-protector-strong -fstack-clash-protection") endif()