diff options
author | Jordan Rose <jordan_rose@apple.com> | 2014-02-05 00:02:37 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2014-02-05 00:02:37 +0000 |
commit | 1b7969eee250d4e3d12666a909971dd26adcbd77 (patch) | |
tree | 2752ac4fc39930bccad3195a1852f34ea2da82a9 /cmake/config-ix.cmake | |
parent | 7e369ff2e564495211e9cc3d6224057c804621fe (diff) | |
download | llvm-1b7969eee250d4e3d12666a909971dd26adcbd77.tar.gz llvm-1b7969eee250d4e3d12666a909971dd26adcbd77.tar.bz2 llvm-1b7969eee250d4e3d12666a909971dd26adcbd77.tar.xz |
[CMake] Move -stdlib=libc++ handling into its own file.
r200744 moved this into cmake/config-ix.cmake, so that it would happen very
early in the build process. However, standalone builds of Clang and other
external projects never include this file (which is correct).
Now, -stdlib=libc++ and the LLVM_COMPILER_IS_GCC_COMPATIBLE option are
both set in a new include file, HandleLLVMStdlib, which is included by
both config-ix.cmake and HandleLLVMOptions.cmake. This preserves existing
behavior for projects relying on HandleLLVMOptions and still does the
right thing for builds of LLVM itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/config-ix.cmake')
-rwxr-xr-x | cmake/config-ix.cmake | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index c9a5044099..c58e5bd97b 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -11,6 +11,8 @@ include(CheckFunctionExists) include(CheckCXXSourceCompiles) include(TestBigEndian) +include(HandleLLVMStdlib) + if( UNIX AND NOT BEOS ) # Used by check_symbol_exists: set(CMAKE_REQUIRED_LIBRARIES m) @@ -34,25 +36,6 @@ function(check_type_exists type files variable) " ${variable}) endfunction() -function(append_if condition value) - if (${condition}) - foreach(variable ${ARGN}) - set(${variable} "${${variable}} ${value}" PARENT_SCOPE) - endforeach(variable) - endif() -endfunction() - -include(CheckCXXCompilerFlag) -if( LLVM_COMPILER_IS_GCC_COMPATIBLE ) - 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() - # include checks check_include_file_cxx(cxxabi.h HAVE_CXXABI_H) check_include_file(dirent.h HAVE_DIRENT_H) |