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

Catalyst compatibility #49

Closed
mackworth opened this issue Apr 29, 2020 · 11 comments · Fixed by #55
Closed

Catalyst compatibility #49

mackworth opened this issue Apr 29, 2020 · 11 comments · Fixed by #55
Assignees

Comments

@mackworth
Copy link

Has anyone used/modified this script to build the Boost framework for Mac Catalyst?

@mackworth mackworth changed the title Catalyst compatability Catalyst compatibility Apr 29, 2020
@faithfracture
Copy link
Owner

Not that I know of. I haven't tried it, but I do have Catalyst support in my list of stuff to do for the project I use this scrip for. I have no idea when that will happen though. I've got half a mind to just click the button and try it out for funsies, but there's nothing in the immediate future AFAIK.

Looking at this SO question, it seems that we would need to add a new target type for it to work with Catalyst.

@mackworth
Copy link
Author

There's also this one:
https://stackoverflow.com/a/58703723/580850
Which suggests:

xcodebuild -configuration "Debug" ARCHS="x86_64h" -destination 'platform=macOS,variant=Mac Catalyst' -project "MyApp.xcodeproj"

and the other one there to build into a framework:

xcodebuild archive -project "$FRAMEWORK".xcodeproj -scheme "$FRAMEWORK" \  
    -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \  
    -archivePath "$FRAMEWORK"MC.xcarchive SKIP_INSTALL=NO clean  

strangely, the second doesn't include the "h" in "x86_64h"

I tried hacking these in, but only made a mess of it.

@mackworth
Copy link
Author

Not to be annoying, but any thoughts here? At WWDC yesterday, Apple is clearly making Catalyst a full Mac citizen, and I'd love to be able to try out my product.

@faithfracture
Copy link
Owner

Oops, sorry - I got caught up with stuff & forgot about this. I'll make this a priority & get something figured out.

I agree, clearly Catalyst needs to be supported here. We'll also need to add support or Apple Silicon (hopefully I get a DTK!)

@faithfracture faithfracture self-assigned this Jun 23, 2020
@guillaumealgis
Copy link
Collaborator

I added support to create a .xcframework a few months ago on my fork. I'll try to get a PR set up to upstream those changes.

@Deadpikle
Copy link
Contributor

Deadpikle commented Jul 29, 2020

Hmmm, wanted to chime in here that I'm having issues getting an Apple Silicon xcframework build to work. I've been trying to get it to build arm64 with x86_64 (by tweaking what --universal attempts to create), but the creation of the xcframework gives the error: Both macos-x86_64 and macos-arm64 represent two equivalent library definitions.

Not sure if anyone has any ideas. The builds themselves seem to go OK (I can lipo -archs the .a files and it says arm64), but I can't get the xcframework to create. Does this somehow have to go to a different "destination" ? (see https://help.apple.com/xcode/mac/11.0/#/dev544efab96 and -destination flag for the archive call.)

For the record, I have the same problem if I use the normal --universal flag that tries to create i386 with x86_64. The only hint I have found on this is a random comment in a pull request for Firebase: https://github.com/firebase/firebase-ios-sdk/pull/4737/files#diff-ae87db694a268f93c6029c8b91a3b9edR334

Didn't want to make a new issue since Apple Silicon was already mentioned here along with the .xcframework building. Can always do so if wanted.

Edit: I can make an xcframework with just arm64. I wonder if we could just do it separately and jam 'em together at the end by manually updating the Info.plist...

@guillaumealgis
Copy link
Collaborator

@Deadpikle I'm working on a version of the script to build for Catalyst at the moment : https://github.com/ipsosante/Apple-Boost-BuildScript/tree/catalyst
I'm don't think the problems are the same for arm64 macOS, but maybe that'll help.

I have no intention to get a DTK so I won't be able to test building for Apple Silicon Macs, but I can take a look anyway (I should be able to build it fine, I just won't be able to use the framework myself).

Edit: I can make an xcframework with just arm64. I wonder if we could just do it separately and jam 'em together at the end by manually updating the Info.plist...

Absolutely! I you can get a build of boost for arm64 linking the macOS SDK, you should be able to just patch it into the xcframework and get things to work (that's what the script is supposed to do 😊)

@faithfracture
Copy link
Owner

FWIW - I do plan on getting a DTK, so if I actually get one this is one of the things I'm definitely going to make work (if someone else hasn't already gotten it there before then).

@mackworth
Copy link
Author

I do have one, and as soon as the script can generate a catalyst-compatible xcframework, I'm happy to test trial versions out.

@Deadpikle
Copy link
Contributor

Deadpikle commented Jul 30, 2020

@Deadpikle I'm working on a version of the script to build for Catalyst at the moment : https://github.com/ipsosante/Apple-Boost-BuildScript/tree/catalyst
I'm don't think the problems are the same for arm64 macOS, but maybe that'll help.

I have no intention to get a DTK so I won't be able to test building for Apple Silicon Macs, but I can take a look anyway (I should be able to build it fine, I just won't be able to use the framework myself).

I think this is helpful, thanks. I think I am building things incorrectly, which is why I'm getting the error when I try to create the xcframework. I'll have to report back with findings (if I have any worth sharing 🤣). I don't have a DTK to test, but I can at least try building!

Just an FYI for anyone else that tries this: Once you've got the Xcode 12 beta, you can make sure it is being used for console commands by running sudo /usr/bin/xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer on the console.

@mackworth
Copy link
Author

Thank you!

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

Successfully merging a pull request may close this issue.

4 participants