Allow the LLD CMake build to work with -std=gnu++0x and -std=gnu++11 as
authorChandler Carruth <chandlerc@gmail.com>
Sat, 19 Jan 2013 09:41:42 +0000 (09:41 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 19 Jan 2013 09:41:42 +0000 (09:41 +0000)
well as c++0x and c++11. This can be especially useful when building
with GCC in C++11 mode.

llvm-svn: 172897

lld/CMakeLists.txt

index 8fd25a9..83043fd 100644 (file)
@@ -77,7 +77,9 @@ elseif (NOT MSVC)
   if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR
       "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
     if (NOT ("${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+0x" OR
-             "${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+11"))
+             "${CMAKE_CXX_FLAGS}" MATCHES "-std=gnu\\+\\+0x" OR
+             "${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+11" OR
+             "${CMAKE_CXX_FLAGS}" MATCHES "-std=gnu\\+\\+11"))
       message(FATAL_ERROR
         "lld requires c++11. Clang and gcc require -std=c++0x or -std=c++11 to "
         "enter this mode. Please set CMAKE_CXX_FLAGS accordingly.")