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

Question: iOS supported? #30

Closed
dhombios opened this issue Aug 7, 2018 · 12 comments
Closed

Question: iOS supported? #30

dhombios opened this issue Aug 7, 2018 · 12 comments

Comments

@dhombios
Copy link

dhombios commented Aug 7, 2018

I could not find if iOS is supported by gdnative, which will be really useful as it would allow to share c code between android and iOS devices at native speed.
On the other hand, can the compilation process for each target be automated with scons during the exportation?

@BastiaanOlij
Copy link
Collaborator

Apple doesn't allow you to include dynamic libraries on iOS. The whole process is very different on iOS where you can statically link your plugin to Godot but I have no hands on experience with this. Endragor on IRC has more experience with this.

Compiling from the editor is a difficult subject because there are such wide varieties. Cross compiling for different platforms is even more difficult and not even supported by all compilers. There are people looking into this but it's a lot of work. Hopefully someone with past experience will step in some day.

@dhombios
Copy link
Author

dhombios commented Aug 8, 2018

Thanks, I thought in iOS was statically linked, as some sources seem to be recompiled during the exportation process

@BastiaanOlij
Copy link
Collaborator

@dhombios indeed, I just don't have experience with the process and what should be altered to the samples. Endragor did a lot of work on this but I don't know if he did a write up of how it works. @karroffel do you know?

@karroffel
Copy link
Contributor

I think there's a special version of the iOS export template that's not linked yet. The code has to be compiled into a static library, then added as additional sources.

Never done it, I can't tell you how it works from a user perspective

@aaronfranke
Copy link
Member

Is it still not possible to use GDNative on iOS? If so, this should be documented.

@sheepandshepherd
Copy link

It is possible. As karroffel mentioned, the library just needs to be statically linked to Godot and have a unique symbol_prefix.

Here's an example of a C++ project working on iOS. See the iOS build instructions in the readme and the SConstruct file: https://github.com/utopia-rise/fmod-gdnative/

@SIsilicon
Copy link

So according to the pull request above, should the godot c++ bindings now be able to compile for iOS too?

@BastiaanOlij
Copy link
Collaborator

iOS plugins have been working for awhile but I'm keeping this issue open as I believe we're missing documentation around this.

@akien-mga
Copy link
Member

akien-mga commented Sep 27, 2021

CC @naithar @bruvzg

@naithar
Copy link

naithar commented Oct 6, 2021

GDNative plugins was working even before godotengine/godot#39996 was merged, but it required static libraries to work. PR allowed to use dynamic libraries/frameworks.

I was following https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html documentation to build iOS plugin and found no issue.

@akien-mga
Copy link
Member

Thanks, closing then.

@mikeheyn
Copy link

mikeheyn commented Apr 11, 2024

Quick response for future onlookers - @naithar 's link I believe is now:
https://docs.godotengine.org/en/3.5/tutorials/scripting/gdnative/gdnative_cpp_example.html

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

No branches or pull requests

9 participants