[PATCH] D24007: [CMake] Use -std=c++11 if supported

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 29 14:53:51 PDT 2016


beanz created this revision.
beanz added a reviewer: EricWF.
beanz added a subscriber: cfe-commits.

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.

https://reviews.llvm.org/D24007

Files:
  cmake/config-ix.cmake

Index: cmake/config-ix.cmake
===================================================================
--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -37,6 +37,11 @@
 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_CXX11)
+
+if(LIBCXXABI_HAS_CXX11)
+  list(APPEND CMAKE_CXX_FLAGS -std=c++11)
+endif()
 
 # Check libraries
 check_library_exists(c fopen "" LIBCXXABI_HAS_C_LIB)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24007.69619.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160829/3dc739e2/attachment.bin>


More information about the cfe-commits mailing list