[libcxxabi] r280021 - [CMake] Use -std=c++11 if supported

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 29 15:12:22 PDT 2016


Author: cbieneman
Date: Mon Aug 29 17:12:21 2016
New Revision: 280021

URL: http://llvm.org/viewvc/llvm-project?rev=280021&view=rev
Log:
[CMake] Use -std=c++11 if supported

Summary: This patch adds a check for if -std=c++11 is a supported flag, and adds it to CMAKE_CXX_FLAGS if it is supported.

Reviewers: EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24007

Modified:
    libcxxabi/trunk/cmake/config-ix.cmake

Modified: libcxxabi/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/config-ix.cmake?rev=280021&r1=280020&r2=280021&view=diff
==============================================================================
--- libcxxabi/trunk/cmake/config-ix.cmake (original)
+++ libcxxabi/trunk/cmake/config-ix.cmake Mon Aug 29 17:12:21 2016
@@ -37,6 +37,11 @@ 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)
+  list(APPEND CMAKE_CXX_FLAGS -std=c++11)
+endif()
 
 # Check libraries
 check_library_exists(c fopen "" LIBCXXABI_HAS_C_LIB)




More information about the cfe-commits mailing list