Skip to content

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

Merged
merged 1 commit into from
Jul 1, 2017
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 src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@ if(USE_GOLD_LINKER)
-fuse-ld=gold)
endif()

# Temporary staging; the various swift projects that depend on libdispatch
# all expect libdispatch.so to be in src/.libs/libdispatch.so
# So for now, make a copy so we don't have to do a coordinated commit across
# all the swift projects to change this assumption.
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")
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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.


install(TARGETS
dispatch
DESTINATION
Expand Down