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

Support for use with XCode? #21

Open
atyshka opened this issue Aug 26, 2020 · 3 comments
Open

Support for use with XCode? #21

atyshka opened this issue Aug 26, 2020 · 3 comments

Comments

@atyshka
Copy link

atyshka commented Aug 26, 2020

Hi Saleem, maybe not the most relevant place to post but better then filing a CMake issue: have you successfully gotten CMake swift support working so that a Swift library can be compiled with CMake and imported into XCode? Presumably the problem is twofold, both getting CMake to properly compile for the architecture and getting XCode to import the library. Regarding the first, I'm aware of several ios CMake toolchains with guides for C but not swift, hopefully differences would be minor or just work out of the box. I'm unsure how one would go about the latter. No need to implement an example here, I'm undertaking this myself and may submit a PR with example if I get this working, just thought I'd see if you had any resources/tips to point me in the right direction.

@compnerd
Copy link
Owner

compnerd commented Aug 26, 2020

I think that the existing examples should give you a pretty starting point. I think that the one big difference you will find is that CMAKE_OSX_ARCHITECTURES may not (at least I do not expect it to) work.

As to the latter, it might be easier to brush up on someone else's work and use the Xcode generator instead of ninja (replace -G Ninja with -G Xcode). That should allow you to generate an Xcode project that can be added to a workspace.

If you get a nice working example, please feel free to send a PR, that sounds like it would be pretty cool.

@mathieugarcia
Copy link

Hi ! Chiming in.

I'm trying to get the Vendoring example to work with the Xcode generator. Tt works perfectly with Ninja, the Swift module is pulled and linked properly.

However, building with Xcode fail, the module isn't found and the Swift file doesn't build.

Any pointers to get this to work ? I've tried adding a dependency to the external Swift module to the executable, to no avail.

Thank you.

@compnerd
Copy link
Owner

I don't know if the necessary functionality is present in the Xcode generator. This might require that you actually modify CMake to enable this functionality.

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

No branches or pull requests

3 participants