forked from OSchip/llvm-project
libcxxabi cmake: Use HandleLLVMOptions.cmake, don't manually add -std=c++11.
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
This commit is contained in:
parent
1326975496
commit
3c2b2ae7a7
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue