Skip to content

Commit 5d50279

Browse files
committed
build: Ensure static headers are always symlinked
When using the Swift static build on Windows, projects like Foundation use the clang headers from the toolchain build `lib` directory. No target in the toolchain build depends on the static clang headers, so they do not get installed. As a workaround, this makes the static clang headers symlink target a dependency of the regular dynamic version of the headers, ensuring they are installed as part of the toolchainb build.
1 parent 1d4e9d0 commit 5d50279

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/SwiftShims/swift/shims/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ add_custom_command_target(unused_var
155155

156156
add_dependencies(copy_shim_headers symlink_clang_headers_static)
157157

158+
# Add dependency to ensure that the static headers are installed. This is needed because no target
159+
# depends on the static headers, so they would not be installed otherwise.
160+
add_dependencies(symlink_clang_headers symlink_clang_headers_static)
161+
158162
if(NOT SWIFT_BUILT_STANDALONE)
159163
if(TARGET clang-resource-headers) # LLVM > 8
160164
set(clang_resource_headers clang-resource-headers)

0 commit comments

Comments
 (0)