how to work with gdnative in godot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By abdolilah

i am new to working with gdnative and c++
and in the .gdnlib file you must provide libs for all kinds of platforms
but i have a problem; i am using linux(distro: pop os running on kde plasma) and cmake to compile c++ code
and in cmake the generated lib from the cmake command add_library(godot_project SHARED ${source_files}) is a .so lib
and in the .gdnlib file for it to work in windows and osx and android and ios you must provide a .dll and .dylib and … libs for it to work in other platform

so how can i compile c++ code in cmake for other platforms(windows and osx and android and ios)

i am a big fan of godot and i dont want to move to UE4 for such a problem

so please any help; i will be thankful

Keep in mind that GDNative isn’t supported on IOS, see here: GitHub - godotengine/godot-cpp at 3.2

omggomb | 2021-03-07 15:50

thank you for your comment

abdolilah | 2021-03-08 18:24

They say it’s still possible with static linking on ios.

sash-rc | 2021-03-11 19:57

Hi! I’m a bit late, but I managed to cross-compile the Godot gdnative stuff using cmake from linux to windows with mingw, you can take a look at my project here, and that is how I do it with an additional file mingw-w64-x86_64.cmake I found on the internet, you can take a look at the bash script build_windows.sh

1234ab | 2021-04-22 13:47