coreaudio-sys icon indicating copy to clipboard operation
coreaudio-sys copied to clipboard

Fix iOS bindings

Open Moxinilian opened this issue 7 years ago • 8 comments

This fixes the generation of bindings for iOS. Huge thanks to @huhlig for the help to make this work.

Moxinilian avatar Jun 22 '18 16:06 Moxinilian

It seems like CI is broken for nightly. @Rhuagh

Moxinilian avatar Jun 22 '18 16:06 Moxinilian

Thank you! This fixes my issues with building on OSX.

mtak- avatar Jun 27 '18 22:06 mtak-

@Moxinilian thanks so much for this PR - super excited to hear you managed to get this going with iOS. I'd actually love to hear more about what you're using it for if you're free to share details on the project? Also, I'm guessing you were testing this on a version of macOS? May I ask which version of macOS it does work on?

Also @Rhuagh if you did get a chance to test this and it built fine, which version of macOS?

@mtak- which issue in particular were you running into prior to this PR? Also, if you don't mind me asking, which version of OSX and Xcode do you have on the system which is fixed by this PR?

In summary, I'm just trying to check which versions of macOS are working so far :) If anyone's reading this that happens to be on 10.10 or prior, it would be great to hear whether or not this branch works for you! Otherwise I'll have access to a macbook air which might have 10.10 installed within a weeks time for testing. It would be nice to land this.

mitchmindtree avatar Jul 05 '18 12:07 mitchmindtree

I used latest High Sierra. Come to think of it, I believe we may have fixed without wanting it building for all platforms, either MacOSX or iPhoneOS, considering we're requesting the location of the SDK to Xcode itself. I'm not sure if changing the sysroot is enough however, that would require testing.

Moxinilian avatar Jul 05 '18 14:07 Moxinilian

@mitchmindtree I was trying to build ggez for iOS, (among other game libraries). Just to see what was currently possible with rust. I don't recall the particular issue, but it was definitely path related. So far nothing is really working, so I have no idea if this PR does more than let me build.

I have a couple of notes on the PR that might help as well.

  • iPhoneSimulator is never detected as a platform in the build script even though it is a separate sdk from iPhoneOS (the i386 and x86_64 apple-ios targets should use this platform).
  • Atleast in recent bindgen versions there is a hidden --target= which helps with dropping the erroneous sysroot bindgen appends
    • .clang_arg(format!("--target={}", TARGET_TRIPLE))

Possibly unnecessary flags for your project, but helped with getting other ios bindgen scripts to work

  • .clang_arg("-x")
  • .clang_arg("objective-c")

I am no longer using this as a dependency, hope that helps

mtak- avatar Jul 05 '18 18:07 mtak-

Ah, osx version is 10.13.6 Beta (17G47b) - High Sierra

mtak- avatar Jul 05 '18 18:07 mtak-

This code is fairly old, but I do remember dropping iPhoneSimulator because it was causing issues somewhere, but I don't remember where exactly. Also, what is erroneous with the sysroot argument?

Moxinilian avatar Jul 05 '18 23:07 Moxinilian

Not your sysroot argument. IIRC, at some point bindgen was adding an incorrect sysroot on osx when cross compiling for iOS. I can no longer find it in the bindgen master source.

Sorry for the confusion

mtak- avatar Jul 06 '18 01:07 mtak-