[PATCH] When building with LLVM_ENABLE_CXX11 using cmake on OS X, try to use libc++. While the main LLVM code base does not required yet libc++ features, lld and lldb already rely on modern STL classes and so failed to compile on OS X if -stdlib=libc++ is...

Jean-Daniel Dupas devlists at shadowlab.org
Wed Dec 11 05:41:15 PST 2013


...not passed to the compiler.

http://llvm-reviews.chandlerc.com/D2381

Files:
  cmake/modules/HandleLLVMOptions.cmake

Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -249,6 +249,10 @@
   if (LLVM_ENABLE_CXX11)
     check_cxx_compiler_flag("-std=c++11" CXX_SUPPORTS_CXX11)
     append_if(CXX_SUPPORTS_CXX11 "-std=c++11" CMAKE_CXX_FLAGS)
+    if (APPLE)
+      check_cxx_compiler_flag("-stdlib=libc++" CXX_SUPPORTS_STDLIB)
+      append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_CXX_FLAGS)
+    endif ()
   endif (LLVM_ENABLE_CXX11)
 endif( MSVC )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2381.1.patch
Type: text/x-patch
Size: 586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131211/4884e502/attachment.bin>


More information about the llvm-commits mailing list