Skip to content

Commit e0ceb57

Browse files
committed
CMake compatibility with Swift build assumptions
All of the swift projects that depend on finding libdispatch.so during their builds (swift, foundation, swiftpm) all expect it to be in src/.libs/libdispatch.so (libtool convention). Temporarily add a rule to copy the built library to where libtool would have placed it to decouple using CMake for libdispatch from updating all of the other dependent projects' build expectations.
1 parent e591e7e commit e0ceb57

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ if(USE_GOLD_LINKER)
188188
-fuse-ld=gold)
189189
endif()
190190

191+
# Temporary staging; the various swift projects that depend on libdispatch
192+
# all expect libdispatch.so to be in src/.libs/libdispatch.so
193+
# So for now, make a copy so we don't have to do a coordinated commit across
194+
# all the swift projects to change this assumption.
195+
add_custom_command(TARGET dispatch POST_BUILD
196+
COMMAND cmake -E make_directory .libs
197+
COMMAND cmake -E copy $<TARGET_FILE:dispatch> .libs
198+
COMMENT "Copying libdispatch to .libs")
199+
191200
install(TARGETS
192201
dispatch
193202
DESTINATION

0 commit comments

Comments
 (0)