Browse Source

CMake: Use gnu++* instead of c++*

This is for consistency with the CMake 3.1+ behavior and allows the use of
GNU extensions.

Thanks @rdb!
Sam Edwards 8 years ago
parent
commit
de03c2f7ff
1 changed files with 3 additions and 3 deletions
  1. 3 3
      CMakeLists.txt

+ 3 - 3
CMakeLists.txt

@@ -10,11 +10,11 @@ enable_testing()
 # the box; for older versions we take a shot in the dark:
 # the box; for older versions we take a shot in the dark:
 if(CMAKE_VERSION VERSION_LESS "3.1")
 if(CMAKE_VERSION VERSION_LESS "3.1")
   include(CheckCXXCompilerFlag)
   include(CheckCXXCompilerFlag)
-  check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
+  check_cxx_compiler_flag("-std=gnu++11" COMPILER_SUPPORTS_CXX11)
   if(COMPILER_SUPPORTS_CXX11)
   if(COMPILER_SUPPORTS_CXX11)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
   else()
   else()
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
   endif()
   endif()
 else()
 else()
   set(CMAKE_CXX_STANDARD 11)
   set(CMAKE_CXX_STANDARD 11)