[CMake] Don't use CLANG_DEFAULT_* values

These are not necessarily correct, just because Clang is configured
to use libc++ or compiler-rt as defaults doesn't mean that the host
compiler uses these as defaults as well. A more correct solution
would be to test the host compiler to check what the default actually
is as attempted in D46857.

Part of PR-38025.

Differential Revision: https://reviews.llvm.org/D49272

llvm-svn: 337033
This commit is contained in:
Petr Hosek 2018-07-13 19:16:30 +00:00
parent 291e6c5db6
commit 2d46cfedf2
1 changed files with 2 additions and 7 deletions

View File

@ -142,10 +142,7 @@ set(CXXABIS none default libstdc++ libc++)
set_property(CACHE SANITIZER_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
if (SANITIZER_CXX_ABI STREQUAL "default")
if (CLANG_DEFAULT_CXX_STDLIB STREQUAL "libc++" AND (TARGET cxx OR HAVE_LIBCXX))
set(SANITIZER_CXX_ABI_LIBNAME "libc++")
set(SANITIZER_CXX_ABI_INTREE 1)
elseif (APPLE)
if (APPLE)
set(SANITIZER_CXX_ABI_LIBNAME "libc++")
set(SANITIZER_CXX_ABI_SYSTEM 1)
elseif (FUCHSIA)
@ -164,9 +161,7 @@ set(COMPILER_RT_RUNTIME "default" CACHE STRING
"Compiler runtime to use.")
if (COMPILER_RT_RUNTIME STREQUAL "default")
if (CLANG_DEFAULT_RTLIB STREQUAL "compiler-rt")
set(COMPILER_RT_RUNTIME_LIBRARY "builtins")
elseif (FUCHSIA)
if (FUCHSIA)
set(COMPILER_RT_RUNTIME_LIBRARY "builtins")
endif()
else()