[llvm-branch-commits] [libcxxabi] 4a6b368 - Revert "Reapply "[libc++abi] Stop copying headers to the build directory""
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Nov 11 16:19:50 PST 2024
Author: Alexander Richardson
Date: 2024-11-11T16:19:47-08:00
New Revision: 4a6b368cefbddda3d98815557b991c0449262659
URL: https://github.com/llvm/llvm-project/commit/4a6b368cefbddda3d98815557b991c0449262659
DIFF: https://github.com/llvm/llvm-project/commit/4a6b368cefbddda3d98815557b991c0449262659.diff
LOG: Revert "Reapply "[libc++abi] Stop copying headers to the build directory""
This reverts commit fd799add2186356dc19e81106a1428a2edf7c20b.
Added:
Modified:
libcxxabi/CMakeLists.txt
libcxxabi/include/CMakeLists.txt
Removed:
################################################################################
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 50e9a296a4a13b..da0e8b286cddc1 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -86,6 +86,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 0deb7b1eb9e715..5b1cc2545016ec 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_
diff erent ${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)
More information about the llvm-branch-commits
mailing list