godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.57k stars 472 forks source link

What are the keywords referenced by ios platform in *.gdextension? #1283

Open CancerQ opened 8 months ago

CancerQ commented 8 months ago

Godot version

4.0.4

godot-cpp version

4.0

System information

iPhone X

Issue description

What are the keywords referenced by ios platform in *.gdextension? What is the key for ios? Whether I defined it correctly, there is no mention of ios in the use case

macos.debug = "res://gdnative/osx/FMGDNative_Mac.framework"
macos.release = "res://gdnative/osx/FMGDNative_Mac.framework"
android.debug.x86_64 = ""
android.release.x86_64 = ""
android.debug.arm64 = ""
android.release.arm64 = ""
ios.debug.x86_64 = "res://gdnative/ios/FMGDNative_iOS.framework"
ios.release.x86_64 = "res://gdnative/ios/FMGDNative_iOS.framework"
ios.debug.arm64 = "res://gdnative/ios/FMGDNative_iOS.framework"
ios.release.arm64 = "res://gdnative/ios/FMGDNative_iOS.framework"

Steps to reproduce

check https://github.com/godotengine/godot-cpp/blob/master/test/project/example.gdextension

Minimal reproduction project

none

dsnopek commented 8 months ago

The keywords used in the .gdextension file are all "feature tags" - see:

https://docs.godotengine.org/en/stable/tutorials/export/feature_tags.html

Basically, it evaluates each line in order, and if the current platform matches all the feature tags listed, that's the library that it'll load.

The lines you show the issue description look good to me, but I've never personally built a GDExtension for iOS. When I look at the webrtc-native GDExtension which supports iOS, it uses the same feature tags:

ios.debug.arm64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.arm64.dylib"
ios.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.x86_64.simulator.dylib"
ios.release.arm64 = "res://webrtc/lib/libwebrtc_native.ios.template_release.arm64.dylib"
ios.release.x86_64 = "res://webrtc/lib/libwebrtc_native.ios.template_release.x86_64.simulator.dylib"
CancerQ commented 8 months ago

The keywords used in the .gdextension file are all "feature tags" - see:

https://docs.godotengine.org/en/stable/tutorials/export/feature_tags.html

Basically, it evaluates each line in order, and if the current platform matches all the feature tags listed, that's the library that it'll load.

The lines you show the issue description look good to me, but I've never personally built a GDExtension for iOS. When I look at the webrtc-native GDExtension which supports iOS, it uses the same feature tags:

ios.debug.arm64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.arm64.dylib"
ios.debug.x86_64 = "res://webrtc/lib/libwebrtc_native.ios.template_debug.x86_64.simulator.dylib"
ios.release.arm64 = "res://webrtc/lib/libwebrtc_native.ios.template_release.arm64.dylib"
ios.release.x86_64 = "res://webrtc/lib/libwebrtc_native.ios.template_release.x86_64.simulator.dylib"

I used the self-built xcode project to compile the version 3.5, and the suffix should be framework, otherwise dylib may fail to upload the App Store