fix flags: backport 4ef3bc602f and set C++11/C++0X depends on compiler
* property set flags due C++11 now is need in all the code * also its need due commit a4cd5f8e48 and 8507e651eb optimizations * almost the last changes need c++11 standard, this is c++0x in olders * build in jsoncpp need it to compile
This commit is contained in:
parent
0f9d6c3982
commit
582ee14446
@ -742,6 +742,21 @@ if(MSVC)
|
||||
set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MT")
|
||||
else()
|
||||
# Probably GCC
|
||||
if (CMAKE_VERSION VERSION_LESS "2.8.10")
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif()
|
||||
set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}")
|
||||
else ()
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
endif()
|
||||
endif ()
|
||||
if(WARN_ALL)
|
||||
set(RELEASE_WARNING_FLAGS "-Wall")
|
||||
else()
|
||||
@ -771,15 +786,6 @@ else()
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Ttext-segment=0x200000000")
|
||||
endif()
|
||||
endif()
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}")
|
||||
set (CMAKE_CXX_FLAGS "--std=gnu++0x ${CMAKE_C_FLAGS}")
|
||||
endif ()
|
||||
else ()
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif ()
|
||||
endif()
|
||||
if(WIN32 AND NOT ZLIBWAPI_DLL AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set(OTHER_FLAGS "${OTHER_FLAGS} -DWIN32_NO_ZLIB_WINAPI")
|
||||
|
Loading…
x
Reference in New Issue
Block a user