Skip to content

Conversation

arichardson
Copy link
Member

This was needed before #115077
since the compiler-rt test build made assumptions about the build
layout of libc++ and libc++abi, but now they link against a local
installation of these libraries so we no longer need this workaround.

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@arichardson arichardson requested a review from a team as a code owner November 5, 2024 23:14
@llvmbot llvmbot added the libc++abi libc++abi C++ Runtime Library. Not libc++. label Nov 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 5, 2024

@llvm/pr-subscribers-libcxxabi

Author: Alexander Richardson (arichardson)

Changes

This was needed before #115077
since the compiler-rt test build made assumptions about the build
layout of libc++ and libc++abi, but now they link against a local
installation of these libraries so we no longer need this workaround.


Full diff: https://github.com/llvm/llvm-project/pull/115086.diff

2 Files Affected:

  • (modified) libcxxabi/CMakeLists.txt (-6)
  • (modified) libcxxabi/include/CMakeLists.txt (-13)
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index da0e8b286cddc1..50e9a296a4a13b 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -86,12 +86,6 @@ 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 5b1cc2545016ec..0deb7b1eb9e715 100644
--- a/libcxxabi/include/CMakeLists.txt
+++ b/libcxxabi/include/CMakeLists.txt
@@ -3,20 +3,7 @@ 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)

@arichardson arichardson requested a review from ldionne November 5, 2024 23:15
@arichardson
Copy link
Member Author

Depends on #115077. Hopefully that is sufficient to remove this workaround.

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we do the same for libc++ as well?

@arichardson
Copy link
Member Author

Can't we do the same for libc++ as well?

Looks like CI is happy on this one so I'll try the same with libc++ next.

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the cleanup!

Created using spr 1.3.6-beta.1
@arichardson arichardson changed the base branch from users/arichardson/spr/main.libcabi-stop-copying-headers-to-the-build-directory to main November 6, 2024 19:59
@arichardson arichardson merged commit 5be02d7 into main Nov 6, 2024
1 check was pending
@arichardson arichardson deleted the users/arichardson/spr/libcabi-stop-copying-headers-to-the-build-directory branch November 6, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++abi libc++abi C++ Runtime Library. Not libc++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants