Skip to content

[CMake] In LLVM unified builds, depend on the generation of Clang headers #70144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions SwiftCompilerSources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@ else()
add_library(importedHeaderDependencies "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp")
target_include_directories(importedHeaderDependencies PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../include/swift")

# When building unified, we need to make sure all the Clang headers are
# generated before we try to use them.
# When building Swift against an already compiled LLVM/Clang, like
# build-script does, this target does not exist, but the headers
# are already completely generated at that point.
if(TARGET clang-tablegen-targets)
add_dependencies(importedHeaderDependencies clang-tablegen-targets)
endif()

if(BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|CROSSCOMPILE")

if (NOT SWIFT_EXEC_FOR_SWIFT_MODULES)
Expand Down