-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add target triple arm-apple-darwin
for cross-compiling to iOS
#10203
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
@@ -193,6 +193,35 @@ CFG_LDPATH_i686-unknown-linux-gnu := | |||
CFG_RUN_i686-unknown-linux-gnu=$(2) | |||
CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2)) | |||
|
|||
# arm-apple-darwin configuration | |||
CFG_IOS_VERSION=7.0 | |||
CFG_IOS_TOOLS=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ |
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.
Should this be using something like xcode-select -p
to get the path to the Developer
folder? This also seems like it'd make a good variable in all the related CFG_IOS_FLAGS
below.
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 tool paths we may want xcrun -find -sdk iphoneos clang
etc. and xcrun --show-sdk-path -sdk iphoneos
for the SDK path.
Can we use back ticks or something similar like in shells here?
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.
I believe that make has $(shell cmd)
to be able to run commands, although you'd need to be careful because we probably shouldn't be executing xcrun
on things like linux system.s
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.
Maybe guarding it in ifeq ($(shell uname -s),Darwin)
?
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.
Instead of forking more processes, I'd recommend looking at CFG_HOST
and it's derived variables as well.
Exciting developments! |
This looks like if you attempt to target Perhaps it would be nice to put a check in |
@alexcrichton: rebased |
Great to see someone else trying this... would be curious to know if the issues i'd run into are any easier now |
Having less C++ today helps a bit. Some issues remain, but other projects have faced them, too. |
This is based on the work by @dobkeratops, updated and extended to work for Xcode 5. This gets you going. I will add separate PRs for compilation/linking fixes. See also https://github.com/mozilla/rust/wiki/Doc-building-for-ios
Suppress the triggering of some lints in derived structures Fixes rust-lang#10185 Fixes rust-lang#10417 For `integer_arithmetic`, `arithmetic_side_effects` and `shadow_reuse`. * ~~Not sure how to test these use-cases so feel free to point any method or any related PR.~~ --- changelog: FP: [`integer_arithmetic`], [`arithmetic_side_effects`]: No longer lint inside proc macros [rust-lang#10203](rust-lang/rust-clippy#10203) <!-- changelog_checked -->
This is based on the work by @dobkeratops, updated and extended to work for Xcode 5.
This gets you going. I will add separate PRs for compilation/linking fixes.
See also https://github.com/mozilla/rust/wiki/Doc-building-for-ios