mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Force activation С++11 for GCC/Clang/MCST lcc
Added GCC/Clang/MCST lcc compiler check for support of C++11 standard and force activation C++11 flag for compile. E2K: fixed compile for MCST lcc compiler < 1.24 (default C++ standard in 1.23 is -std=c++03).
This commit is contained in:
parent
f18ccd63d6
commit
a03d827cdf
1 changed files with 10 additions and 0 deletions
|
@ -86,6 +86,16 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|||
#add_definitions(-Wall)
|
||||
add_definitions(-Werror=format-security)
|
||||
add_definitions(-Werror=format)
|
||||
include(CheckCXXCompilerFlag)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
add_definitions(-std=c++11)
|
||||
elseif(COMPILER_SUPPORTS_CXX0X)
|
||||
add_definitions(-std=c++0x)
|
||||
else()
|
||||
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
||||
endif()
|
||||
if(CPU_TYPE)
|
||||
add_definitions(-DCPUSTRING="${CPU_TYPE}")
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue