Add a CMake warning for (mostly) old compilers.

This commit is contained in:
Username404 2021-03-16 16:42:28 +01:00
parent 1b3c135b03
commit 4235bb4ce3
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 0 deletions

View File

@ -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()