diff options
Diffstat (limited to 'modules/gdnative')
-rw-r--r-- | modules/gdnative/SCsub | 2 | ||||
-rw-r--r-- | modules/gdnative/gdnative.cpp | 5 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/gdnative.h | 4 | ||||
-rw-r--r-- | modules/gdnative/include/nativescript/godot_nativescript.h | 4 | ||||
-rw-r--r-- | modules/gdnative/nativescript/SCsub | 3 |
5 files changed, 12 insertions, 6 deletions
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index f386f2b542..39f5ec5378 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -11,7 +11,7 @@ gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp") gdn_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) gdn_env.Append(CPPPATH=['#modules/gdnative/include/']) -if "platform" in env and env["platform"] == "x11": # there has to be a better solution? +if "platform" in env and env["platform"] in ["x11", "iphone"]: env.Append(LINKFLAGS=["-rdynamic"]) env.use_ptrcall = True diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 93a9bac11c..11856e4ffb 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -234,8 +234,11 @@ bool GDNative::initialize() { ERR_PRINT("No library set for this platform"); return false; } - +#ifdef IPHONE_ENABLED + String path = lib_path.replace("res://", "dylibs/"); +#else String path = ProjectSettings::get_singleton()->globalize_path(lib_path); +#endif Error err = OS::get_singleton()->open_dynamic_library(path, native_handle); if (err != OK) { return false; diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 18d51daeb3..19dd030637 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -49,8 +49,8 @@ extern "C" { #elif defined(__APPLE__) #include "TargetConditionals.h" #if TARGET_OS_IPHONE -#define GDCALLINGCONV -#define GDAPI +#define GDCALLINGCONV __attribute__((visibility("default"))) +#define GDAPI GDCALLINGCONV #elif TARGET_OS_MAC #define GDCALLINGCONV __attribute__((sysv_abi)) #define GDAPI GDCALLINGCONV diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index 96f213ead7..5095b7a83e 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -51,8 +51,8 @@ extern "C" { #elif defined(__APPLE__) #include "TargetConditionals.h" #if TARGET_OS_IPHONE -#define GDCALLINGCONV -#define GDAPI +#define GDCALLINGCONV __attribute__((visibility("default"))) +#define GDAPI GDCALLINGCONV #elif TARGET_OS_MAC #define GDCALLINGCONV __attribute__((sysv_abi)) #define GDAPI GDCALLINGCONV diff --git a/modules/gdnative/nativescript/SCsub b/modules/gdnative/nativescript/SCsub index e980e40e8e..178afec64a 100644 --- a/modules/gdnative/nativescript/SCsub +++ b/modules/gdnative/nativescript/SCsub @@ -7,4 +7,7 @@ mod_env.add_source_files(env.modules_sources, "*.cpp") mod_env.Append(CPPPATH='#modules/gdnative') mod_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) +if "platform" in env and env["platform"] in ["x11", "iphone"]: + env.Append(LINKFLAGS=["-rdynamic"]) + Export('mod_env') |