Fix re-building in-tree libc++ against in-tree libc++abi

Differential Revision: http://reviews.llvm.org/D4805

llvm-svn: 215186
This commit is contained in:
Viktor Kutuzov 2014-08-08 06:53:30 +00:00
parent 7a27160780
commit 88d6dc962a
2 changed files with 15 additions and 12 deletions

View File

@ -45,15 +45,18 @@ option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)
set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)
if (NOT DEFINED LIBCXX_CXX_ABI)
if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
set(LIBCXX_CXX_ABI "libcxxabi")
if (NOT LIBCXX_CXX_ABI)
if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND
IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_LIBCXXABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
set(LIBCXX_CXX_ABI_INTREE 1)
else ()
set(LIBCXX_CXX_ABI "none")
set(LIBCXX_CXX_ABI_LIBNAME "none")
endif ()
endif()
else ()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
endif ()
set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
"Specify C++ ABI library to use." FORCE)
set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
@ -134,13 +137,13 @@ macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs)
)
endmacro()
if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++" OR
"${LIBCXX_CXX_ABI}" STREQUAL "libsupc++")
if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
"${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libsupc++")
set(_LIBSUPCXX_INCLUDE_FILES
cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h
bits/cxxabi_tweaks.h bits/cxxabi_forced.h
)
if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++")
if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++")
set(_LIBSUPCXX_DEFINES "-DLIBSTDCXX")
set(_LIBSUPCXX_LIBNAME stdc++)
else()
@ -151,7 +154,7 @@ if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++" OR
"-D__GLIBCXX__ ${_LIBSUPCXX_DEFINES}"
"${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
)
elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
if (LIBCXX_CXX_ABI_INTREE)
# Link against just-built "cxxabi" target.
set(CXXABI_LIBNAME cxxabi)
@ -162,11 +165,11 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
${CXXABI_LIBNAME} "cxxabi.h" ""
)
elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxrt")
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT"
"cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
)
elseif (NOT "${LIBCXX_CXX_ABI}" STREQUAL "none")
elseif (NOT "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none")
message(FATAL_ERROR
"Currently libstdc++, libsupc++, libcxxabi, libcxxrt and none are "
"supported for c++ abi."

View File

@ -5,7 +5,7 @@ config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@"
config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.enable_shared = @LIBCXX_ENABLE_SHARED@
config.cxx_abi = "@LIBCXX_CXX_ABI@"
config.cxx_abi = "@LIBCXX_CXX_ABI_LIBNAME@"
# Let the main config do the real work.
lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg")