diff options
author | Petr Hosek <phosek@google.com> | 2021-03-25 01:50:11 -0700 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2021-03-25 01:50:11 -0700 |
commit | 74ed5124bae163c2046d589026cf17f4fa71f6f4 (patch) | |
tree | b6d6c547b40c2fe6333b5146a516ea4be3cfb99f | |
parent | b8b23aa80eefe84187d6ba364d06496c90c53bdb (diff) | |
download | llvm-74ed5124bae163c2046d589026cf17f4fa71f6f4.zip llvm-74ed5124bae163c2046d589026cf17f4fa71f6f4.tar.gz llvm-74ed5124bae163c2046d589026cf17f4fa71f6f4.tar.bz2 |
Revert "[libcxxabi] Use cxx-headers target to consume libcxx headers"
This reverts commit 72728e12806ae4f85c7ab79b92f2d1c20981d596
which broke libcxxabi tests under the runtimes build.
-rw-r--r-- | libcxxabi/CMakeLists.txt | 18 | ||||
-rw-r--r-- | libcxxabi/src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | libcxxabi/test/libcxxabi/test/config.py | 5 |
3 files changed, 9 insertions, 20 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index dcbfdcb..8b0c886 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -156,23 +156,9 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC) message(FATAL_ERROR "libc++abi must be built as either a shared or static library.") endif() -# TODO: This is a workaround for the fact that Standalone builds can't use -# targets from the other runtimes (so the cxx-headers target doesn't exist). -set(LIBCXXABI_LIBCXX_INCLUDES "" CACHE PATH +set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXXABI_LIBCXX_PATH}/include" CACHE PATH "Specify path to libc++ includes.") -if (LIBCXXABI_STANDALONE_BUILD) - if (NOT IS_DIRECTORY ${LIBCXXABI_LIBCXX_INCLUDES}) - message(FATAL_ERROR - "LIBCXXABI_LIBCXX_INCLUDES=${LIBCXXABI_LIBCXX_INCLUDES} is not a valid directory. " - "Please provide the path to where the libc++ headers have been installed.") - endif() - add_library(cxx-headers INTERFACE) - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") - target_compile_options(cxx-headers INTERFACE /I "${LIBCXXABI_LIBCXX_INCLUDES}") - else() - target_compile_options(cxx-headers INTERFACE -I "${LIBCXXABI_LIBCXX_INCLUDES}") - endif() -endif() +message(STATUS "Libc++abi will be using libc++ includes from ${LIBCXXABI_LIBCXX_INCLUDES}") option(LIBCXXABI_HERMETIC_STATIC_LIBRARY "Do not export any symbols from the static library." OFF) diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt index 32a998e..a28da22 100644 --- a/libcxxabi/src/CMakeLists.txt +++ b/libcxxabi/src/CMakeLists.txt @@ -56,6 +56,8 @@ if (MSVC_IDE OR XCODE) endif() endif() +include_directories("${LIBCXXABI_LIBCXX_INCLUDES}") + # stdlib_stdexcept.cpp depends on libc++ internals. include_directories("${LIBCXXABI_LIBCXX_PATH}") @@ -176,7 +178,7 @@ endif() # Build the shared library. if (LIBCXXABI_ENABLE_SHARED) add_library(cxxabi_shared SHARED ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS}) - target_link_libraries(cxxabi_shared PRIVATE cxx-headers ${LIBCXXABI_SHARED_LIBRARIES} ${LIBCXXABI_LIBRARIES}) + target_link_libraries(cxxabi_shared PRIVATE ${LIBCXXABI_SHARED_LIBRARIES} ${LIBCXXABI_LIBRARIES}) if (TARGET pstl::ParallelSTL) target_link_libraries(cxxabi_shared PUBLIC pstl::ParallelSTL) endif() @@ -243,7 +245,7 @@ endif() # Build the static library. if (LIBCXXABI_ENABLE_STATIC) add_library(cxxabi_static STATIC ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS}) - target_link_libraries(cxxabi_static PRIVATE cxx-headers ${LIBCXXABI_STATIC_LIBRARIES} ${LIBCXXABI_LIBRARIES}) + target_link_libraries(cxxabi_static PRIVATE ${LIBCXXABI_STATIC_LIBRARIES} ${LIBCXXABI_LIBRARIES}) if (TARGET pstl::ParallelSTL) target_link_libraries(cxxabi_static PUBLIC pstl::ParallelSTL) endif() diff --git a/libcxxabi/test/libcxxabi/test/config.py b/libcxxabi/test/libcxxabi/test/config.py index 8033771..280a60a 100644 --- a/libcxxabi/test/libcxxabi/test/config.py +++ b/libcxxabi/test/libcxxabi/test/config.py @@ -57,8 +57,9 @@ class Configuration(LibcxxConfiguration): def configure_compile_flags_header_includes(self): self.configure_config_site_header() - cxx_headers = self.get_lit_conf('cxx_headers', None) or \ - os.path.join(self.project_obj_root, 'include', 'c++', 'v1') + cxx_headers = self.get_lit_conf( + 'cxx_headers', + os.path.join(self.libcxx_src_root, '/include')) if cxx_headers == '': self.lit_config.note('using the systems c++ headers') else: |