summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJean-Daniel Dupas <devlists@shadowlab.org>2014-01-06 18:27:27 +0000
committerJean-Daniel Dupas <devlists@shadowlab.org>2014-01-06 18:27:27 +0000
commit1abc3c0b7fe517ac7fc0d215c0e93003518e6270 (patch)
tree7aa5bc3316b0063690d3c33bbef9187e45baba04 /cmake
parent34fa3112675535b002bf48d0aaae9abe459ca3da (diff)
downloadllvm-1abc3c0b7fe517ac7fc0d215c0e93003518e6270.tar.gz
llvm-1abc3c0b7fe517ac7fc0d215c0e93003518e6270.tar.bz2
llvm-1abc3c0b7fe517ac7fc0d215c0e93003518e6270.tar.xz
Introduce a cmake LLVM_ENABLE_LIBCXX build parameter to compile using libc++ instead of the system default
Summary: This parameter is required to build C++11 projects (like lld or lldb) on OS X as the default STL does not provide c++ classes. CC: llvm-commits, triton Differential Revision: http://llvm-reviews.chandlerc.com/D2381 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 38dacb7b88..21d2cd6740 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -253,6 +253,13 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
check_cxx_compiler_flag("-std=c++11" CXX_SUPPORTS_CXX11)
append_if(CXX_SUPPORTS_CXX11 "-std=c++11" CMAKE_CXX_FLAGS)
endif (LLVM_ENABLE_CXX11)
+ if(LLVM_ENABLE_LIBCXX)
+ check_cxx_compiler_flag("-stdlib=libc++" CXX_SUPPORTS_STDLIB)
+ append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_CXX_FLAGS)
+ append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_EXE_LINKER_FLAGS)
+ append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_SHARED_LINKER_FLAGS)
+ append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_MODULE_LINKER_FLAGS)
+ endif ()
endif( MSVC )
macro(append_common_sanitizer_flags)