1 # This CMake module is responsible for setting the standard library to libc++
2 # if the user has requested it.
4 include(DetermineGCCCompatible)
6 if(NOT DEFINED LLVM_STDLIB_HANDLED)
7 set(LLVM_STDLIB_HANDLED ON)
10 foreach(variable ${ARGN})
11 set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
15 include(CheckCXXCompilerFlag)
16 if(LLVM_ENABLE_LIBCXX)
17 if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
18 check_cxx_compiler_flag("-stdlib=libc++" CXX_SUPPORTS_STDLIB)
19 if(CXX_SUPPORTS_STDLIB)
20 append("-stdlib=libc++"
21 CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
22 CMAKE_MODULE_LINKER_FLAGS)
23 if(LLVM_ENABLE_LIBCXXABI)
25 CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
26 CMAKE_MODULE_LINKER_FLAGS)
29 message(WARNING "Can't specify libc++ with '-stdlib='")
32 message(WARNING "Not sure how to specify libc++ for this compiler")