Code: Select all
if ((CMAKE_C_COMPILER_ID STREQUAL "GNU") OR (CMAKE_C_COMPILER_ID STREQUAL "Clang"))
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
elseif (NOT CMAKE_VERSION VERSION_LESS "3.1")
set (CMAKE_C_STANDARD_REQUIRED TRUE)
set (CMAKE_C_STANDARD "11")
endif ()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
elseif (NOT CMAKE_VERSION VERSION_LESS "3.1")
set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
set (CMAKE_CXX_STANDARD "11")
endif ()
This makes it so that if CEGUI is compiled with gcc or clang, the gcc-specific compiler extensions will be enabled.
Some projects would prefer not to enable these extensions, because, some of them conflict with the official standard, and others,
might not be supported by other compilers. If people want to statically link CEGUI into their project and it only compiles with
these extensions, though, then they might be forced to change compilers to something that supports these extensions.
Does CEGUI actually use these extensions?
If not, can I request or suggest that we make it `std=c++11` instead of `gnu++11 ` above?