libcxxabi cmake: Use HandleLLVMOptions.cmake, don't manually add -std=c++11.
authorNico Weber <nicolasweber@gmx.de>
Wed, 16 Jul 2014 23:53:37 +0000 (23:53 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 16 Jul 2014 23:53:37 +0000 (23:53 +0000)
No intended behavior change on Linux and Mac OS X.  On Windows, having libcxxabi
in one's checkout should now no longer break running cmake. (cl.exe supports
c++11, but doesn't understand a -std= flag.)

llvm-svn: 213214

libcxxabi/CMakeLists.txt
libcxxabi/cmake/config-ix.cmake

index bbb48b3..a764ed0 100644 (file)
@@ -54,6 +54,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
     list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
     include(${LLVMCONFIG_FILE})
     include("${LLVM_CMAKE_PATH}/AddLLVM.cmake")
+    include("${LLVM_CMAKE_PATH}/HandleLLVMOptions.cmake")
   else()
     message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
   endif()
@@ -154,11 +155,7 @@ endmacro()
 if (LIBCXXABI_HAS_NOSTDINCXX_FLAG)
   list(APPEND LIBCXXABI_CXX_REQUIRED_FLAGS -nostdinc++)
 endif()
-if (NOT LIBCXXABI_HAS_STDCXX11_FLAG)
-  message(FATAL_ERROR "Building libcxxabi requires a C++11 capable compiler.")
-endif()
 
-list(APPEND LIBCXXABI_CXX_REQUIRED_FLAGS -std=c++11)
 append_if(LIBCXXABI_CXX_REQUIRED_FLAGS LIBCXXABI_HAS_WERROR_FLAG -Werror=return-type)
 
 # Get warning flags
index f56fe82..bf444fb 100644 (file)
@@ -2,7 +2,6 @@ include(CheckLibraryExists)
 include(CheckCXXCompilerFlag)
 
 # Check compiler flags
-check_cxx_compiler_flag(-std=c++11            LIBCXXABI_HAS_STDCXX11_FLAG)
 check_cxx_compiler_flag(-fPIC                 LIBCXXABI_HAS_FPIC_FLAG)
 check_cxx_compiler_flag(-fstrict-aliasing     LIBCXXABI_HAS_FSTRICT_ALIASING_FLAG)
 check_cxx_compiler_flag(-nodefaultlibs        LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)