[libcxxabi] r305175 - build: use cmake to pass -std=c++11
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 11 16:59:26 PDT 2017
Author: compnerd
Date: Sun Jun 11 18:59:26 2017
New Revision: 305175
URL: http://llvm.org/viewvc/llvm-project?rev=305175&view=rev
Log:
build: use cmake to pass -std=c++11
Rather than manually checking for support for the spelling of the C++
standard, indicate to CMake that we require that the compiler support
C++11 and that we compile without the GNU extensions. This simplifies
the flags handling in libc++abi itself by relying on CMake to translate
the flag and add it as appropriate.
Modified:
libcxxabi/trunk/cmake/config-ix.cmake
libcxxabi/trunk/src/CMakeLists.txt
Modified: libcxxabi/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/config-ix.cmake?rev=305175&r1=305174&r2=305175&view=diff
==============================================================================
--- libcxxabi/trunk/cmake/config-ix.cmake (original)
+++ libcxxabi/trunk/cmake/config-ix.cmake Sun Jun 11 18:59:26 2017
@@ -81,11 +81,6 @@ check_cxx_compiler_flag(/EHsc
check_cxx_compiler_flag(/EHs- LIBCXXABI_HAS_NO_EHS_FLAG)
check_cxx_compiler_flag(/EHa- LIBCXXABI_HAS_NO_EHA_FLAG)
check_cxx_compiler_flag(/GR- LIBCXXABI_HAS_NO_GR_FLAG)
-check_cxx_compiler_flag(-std=c++11 LIBCXXABI_HAS_STD_CXX11)
-
-if(LIBCXXABI_HAS_STD_CXX11)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-endif()
# Check libraries
check_library_exists(dl dladdr "" LIBCXXABI_HAS_DL_LIB)
Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=305175&r1=305174&r2=305175&view=diff
==============================================================================
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Sun Jun 11 18:59:26 2017
@@ -111,6 +111,12 @@ endif()
add_library(cxxabi_objects OBJECT ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
set_target_properties(cxxabi_objects
PROPERTIES
+ CXX_EXTENSIONS
+ OFF
+ CXX_STANDARD
+ 11
+ CXX_STANDARD_REQUIRED
+ ON
COMPILE_FLAGS
"${LIBCXXABI_COMPILE_FLAGS}"
POSITION_INDEPENDENT_CODE
@@ -124,6 +130,12 @@ if (LIBCXXABI_ENABLE_SHARED)
target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
set_target_properties(cxxabi_shared
PROPERTIES
+ CXX_EXTENSIONS
+ OFF
+ CXX_STANDARD
+ 11
+ CXX_STANDARD_REQUIRED
+ ON
LINK_FLAGS
"${LIBCXXABI_LINK_FLAGS} ${LIBCXXABI_SHARED_LINK_FLAGS}"
OUTPUT_NAME
@@ -143,6 +155,12 @@ if (LIBCXXABI_ENABLE_STATIC)
target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES})
set_target_properties(cxxabi_static
PROPERTIES
+ CXX_EXTENSIONS
+ OFF
+ CXX_STANDARD
+ 11
+ CXX_STANDARD_REQUIRED
+ ON
LINK_FLAGS
"${LIBCXXABI_LINK_FLAGS}"
OUTPUT_NAME
More information about the cfe-commits
mailing list