-
Notifications
You must be signed in to change notification settings - Fork 471
CMake compatibility with Swift build assumptions #267
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
Conversation
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.
@das @compnerd -- staging for invoking libdispatch CMake from swift/utils/build-script. The changes to the other projects to avoid needing this are simple, but I don't want to try to coordinate across all of the repos. So we put in this crutch with the plan of updating the other projects soon after we cut-over to CMake for libdispatch and then getting rid of this. |
@dgrove-oss yeah, I have a pr for that in the swift repo. Don't see a problem with trying to stage it with some hacks in the build system. |
add_custom_command(TARGET dispatch POST_BUILD | ||
COMMAND cmake -E make_directory .libs | ||
COMMAND cmake -E copy $<TARGET_FILE:dispatch> .libs | ||
COMMENT "Copying libdispatch to .libs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this always run? Perhaps have a output to prevent that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me it runs exactly when dispatch is built, which I think is what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the record, can't specify both a TARGET and an OUTPUT in a custom_command.
CMake Error at src/CMakeLists.txt:195 (add_custom_command):
add_custom_command Wrong syntax. A TARGET and OUTPUT can not both be
specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I guess I was mixing up some other behaviour then. If it is only run once, then it is what we want.
lgtm, thanks! |
CMake compatibility with Swift build assumptions Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
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.