Skip to content

Commit

Permalink
[libc++] Default to vcruntime when targeting MSVC
Browse files Browse the repository at this point in the history
Summary:
libc++abi is never the right option for LIBCXX_TARGETING_MSVC, since it
targets the Itanium ABI, whereas MSVC uses the Microsoft ABI. Make the
default ABI be vcruntime when targeting MSVC even if libc++abi is
present in the tree.

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

llvm-svn: 300921
  • Loading branch information
smeenai committed Apr 20, 2017
1 parent c411225 commit 8048b44
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions libcxx/CMakeLists.txt
Expand Up @@ -120,21 +120,19 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
NO_DEFAULT_PATH
)
if ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
if (LIBCXX_TARGETING_MSVC)
# FIXME: Figure out how to configure the ABI library on Windows.
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_INTREE 1)
elseif (APPLE)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)
else()
if (LIBCXX_TARGETING_MSVC)
# FIXME: Figure out how to configure the ABI library on Windows.
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
elseif(APPLE)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)
else()
set(LIBCXX_CXX_ABI_LIBNAME "default")
endif()
set(LIBCXX_CXX_ABI_LIBNAME "default")
endif()
else()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
Expand Down

0 comments on commit 8048b44

Please sign in to comment.