Skip to content

[cmake] Only add lipo targets for Darwin #5101

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
Oct 4, 2016

Conversation

modocache
Copy link
Contributor

Swift's CMake build system creates "fat" binaries for Swift libraries, so long as the host machine used to compile the libraries is a macOS machine. However, when a non-Darwin target, such as Android, is being compiled on a macOS host, this doesn't work. Instead, only add lipo targets if the target is Darwin.

This was pulled out of the larger pull request #4972, which addresses SR-1362.

@@ -357,12 +357,15 @@ endfunction()
#
# Usage:
# _add_swift_lipo_target(
# sdk # The name of the SDK the target was created for.
# # Examples include "OSX", "IOS", "ANDROID", etc.
# target # The name of the target to create
# output # The file to be created by this target
# source_targets... # The source targets whose outputs will be
# # lipo'd into the output.
# )
function(_add_swift_lipo_target target output)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't actually update the function signature…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oomph, my bad. 😓

Thanks for catching that one! I updated the pull request.

Swift's CMake build system creates "fat" binaries for Swift libraries,
so long as the host machine used to compile the libraries is a macOS
machine. However, when a non-Darwin target, such as Android, is being
compiled on a macOS host, this doesn't work. Instead, only add lipo
targets if the *target* is Darwin.
@modocache
Copy link
Contributor Author

@swift-ci please test

@jrose-apple
Copy link
Contributor

LGTM.

@modocache modocache merged commit f653d52 into swiftlang:master Oct 4, 2016
@modocache modocache deleted the cmake-add-lipo-target-sdk branch October 4, 2016 17:40
@modocache
Copy link
Contributor Author

Thanks @jrose-apple! Sorry for the increased pull request review load. :)

@jrose-apple
Copy link
Contributor

I can't speak for the other two but I think I'm net happy to have another pair of hands!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants