Skip to content

Commit 0b05a1e

Browse files
authored
[cxx-interop] Hook libcxxshim modulemap/header to sdk-overlay (#62475)
The modulemap and header files target was added to `ALL`, which works when invoking the build thru the `build-script`, but make some test fail when doing a manual configuration and later doing `check-swift-validation` or similar, because the modulemap/header were not copied into the build directory. Follow a pattern similar to the one in GlibC (which this file seemed to be prepared for, since the `libcxxshim_modulemap_target_list` variable was already there), create a global target for all the modulemap/headers of each SDK and add that global target as a dependency of sdk-overlay (which is a dependency of check-swift-validation and others).
1 parent 7acbf55 commit 0b05a1e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/Cxx/cxxshim/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ foreach(sdk ${SWIFT_SDKS})
3838
add_custom_target(cxxshim-${sdk}-${arch} ALL
3939
DEPENDS ${outputs}
4040
COMMENT "Copying cxxshims to ${module_dir}")
41+
list(APPEND libcxxshim_modulemap_target_list cxxshim-${sdk}-${arch})
4142

4243

4344
swift_install_in_component(FILES libcxxshim.modulemap libcxxshim.h
@@ -50,3 +51,7 @@ foreach(sdk ${SWIFT_SDKS})
5051
endif()
5152
endforeach()
5253
endforeach()
54+
55+
add_custom_target(libcxxshim_modulemap DEPENDS ${libcxxshim_modulemap_target_list})
56+
set_property(TARGET libcxxshim_modulemap PROPERTY FOLDER "Miscellaneous")
57+
add_dependencies(sdk-overlay libcxxshim_modulemap)

0 commit comments

Comments
 (0)