Skip to content
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

Add ios simulator #353

Merged
2 commits merged into from
May 23, 2020
Merged

Add ios simulator #353

2 commits merged into from
May 23, 2020

Conversation

simlay
Copy link
Contributor

@simlay simlay commented May 22, 2020

Closes #352.

  • xcrun --sdk $PLATFORM --show-sdk-path to get the sysroot
  • Adding iphonesimulator support.

I've tested verified that this builds with macos, aarch64-apple-ios (the iPhone) and for x86_64-apple-ios (the ios simulator).

I also added cargo-dinghy to CI so that you can run some of the unit tests in the simulator. The tests in gdnative-sys are really just the bindgen size tests.

I tried running cargo dinghy --platform auto-ios-x86_64 test in the root of the project and there's some weird bug with the examples in dinghy. It could be due to lack of a local lib (like godot as a static lib?) or maybe a bug with dinghy itself. I'm not sure.

@ghost
Copy link

ghost commented May 22, 2020

Travis says that "the x86_64-apple-ios target may not be installed". Maybe you need to add rustup target add x86_64-apple-ios in before_script?

@ghost ghost added feature Adds functionality to the library c: sys Component: low-level bindings (mod sys) labels May 22, 2020
@ghost ghost added this to the 0.8.1 milestone May 22, 2020
@simlay
Copy link
Contributor Author

simlay commented May 23, 2020

Travis says that "the x86_64-apple-ios target may not be installed". Maybe you need to add rustup target add x86_64-apple-ios in before_script?

Ah, yes. Should be fixed now.

@ghost
Copy link

ghost commented May 23, 2020

Seem like it still doesn't work: [2020-05-23T05:28:39Z ERROR cargo_dinghy] No device found. According to Travis docs, an iOS simulator is installed on the default image, but the Xcode version is only at 9.4.1. Maybe a newer version (osx_image: xcode11.4) is required? Maybe cargo-dinghy can't locate it somehow? I'm not familiar enough with it to be a lot of help, sorry.

If the CI can't be made to work, we can leave it out for now, merge the -sys changes, and try to figure it out later.

* Added iphonesimulator case.
* Used xcrun --sdk $PLATFORM --show-sdk-path
* Added cargo-dinghy to travis for ios simulator unit tests
@simlay simlay force-pushed the add-ios-simulator branch from 3851ba2 to 3aa186d Compare May 23, 2020 05:58
Comment on lines 181 to 182
// Workaround: x86_64 architecture is unsupported by the iPhone SDK, but cargo-lipo will
// try to build it anyway. This leads to a clang error, so we'll skip the SDK.
Copy link

Choose a reason for hiding this comment

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

Looks like it's working now. Great! Now we can remove this Workaround comment since it no longer applies. After that it should be good to merge!

Thanks a lot!

@ghost ghost merged commit ceead34 into godot-rust:master May 23, 2020
@simlay simlay deleted the add-ios-simulator branch May 23, 2020 07:34
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: sys Component: low-level bindings (mod sys) feature Adds functionality to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use xcrun for Apple platform SDK path detection
1 participant