diff options
| author | Kirill Stoimenov <kstoimenov@google.com> | 2025-01-14 18:23:07 +0000 |
|---|---|---|
| committer | Kirill Stoimenov <kstoimenov@google.com> | 2025-01-14 18:23:07 +0000 |
| commit | 576b53801fc3d721602ae0d8377af9950f356000 (patch) | |
| tree | 157c8b255912b6908fee2061d366a8e21bb79343 /libcxxabi | |
| parent | 71f238a221ff307a1c079678b85ef3abe43c71ab (diff) | |
Revert "[libc++] Stop copying headers to the build directory (#115380)"
This reverts commit 428c8767ae997b0f726c0b40160ea8172551babf.
Breaks sanitizer build: https://lab.llvm.org/buildbot/#/builders/51/builds/9056
Diffstat (limited to 'libcxxabi')
| -rw-r--r-- | libcxxabi/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | libcxxabi/include/CMakeLists.txt | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 4da42faad674..6dcfc51e5532 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -91,6 +91,12 @@ set(LIBCXXABI_STATIC_OUTPUT_NAME "c++abi" CACHE STRING "Output name for the stat set(LIBCXXABI_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1" CACHE STRING "Path to install the libc++abi headers at.") +if(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXXABI_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1") +else() + set(LIBCXXABI_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1") +endif() + set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE PATH "The path to libc++ library.") set(LIBCXXABI_LIBRARY_VERSION "1.0" CACHE STRING "Version of libc++abi. This will be reflected in the name of the shared \ diff --git a/libcxxabi/include/CMakeLists.txt b/libcxxabi/include/CMakeLists.txt index 0deb7b1eb9e7..5b1cc2545016 100644 --- a/libcxxabi/include/CMakeLists.txt +++ b/libcxxabi/include/CMakeLists.txt @@ -3,7 +3,20 @@ set(files cxxabi.h ) +foreach(f ${files}) + set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}") + set(dst "${LIBCXXABI_GENERATED_INCLUDE_DIR}/${f}") + add_custom_command(OUTPUT ${dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} + COMMENT "Copying CXXABI header ${f}") + list(APPEND _all_includes "${dst}") +endforeach() + +add_custom_target(generate-cxxabi-headers ALL DEPENDS ${_all_includes}) + add_library(cxxabi-headers INTERFACE) +add_dependencies(cxxabi-headers generate-cxxabi-headers) target_include_directories(cxxabi-headers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") if (LIBCXXABI_INSTALL_HEADERS) |
