Skip to content

[build-script-helper] Add support for Android cross-compilation #424

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
Aug 31, 2021

Conversation

finagolfin
Copy link
Member

Add new flags --cross-compile-host and --cross-compile-config and use them to cross-compile, gated only for Android for now. Add a --prefix flag to install to a cross-compiled toolchain instead and set SWIFT_EXEC when using SPM, so it uses the right Swift toolchain.

Along with swiftlang/swift#36917 and an updated version of this build-script patch to pass the right flags in, I have a working sourcekit-lsp running on Android now, after cross-compiling it from linux for the first time. I will submit that second linked patch once this is in.

@benlangmuir
Copy link
Contributor

@swift-ci please test

Add new flags '--cross-compile-host' and '--cross-compile-config' and use them to
cross-compile, gated only for Android for now. Add a '--prefix' flag to install
to a cross-compiled toolchain instead and set 'SWIFT_EXEC' when using SPM, so it
uses the right Swift toolchain.
install(bin_path, args.toolchain)

if not args.install_prefixes:
args.install_prefixes = [args.toolchain]
Copy link
Member Author

Choose a reason for hiding this comment

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

I had tested this default case like this initially, then modified it to just passing args.install_prefixes if not None else [args.toolchain] to the line below and not tested the default case again. For whatever reason, that doesn't work, so going back to this.

@finagolfin
Copy link
Member Author

Ping, just needs another CI run.

@MaxDesiatov
Copy link
Contributor

@swift-ci please test

@finagolfin
Copy link
Member Author

This can be merged, as it doesn't depend on any other pull.

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.

3 participants