diff options
| author | Rémi Verschelde | 2017-09-25 22:23:49 +0200 |
|---|---|---|
| committer | GitHub | 2017-09-25 22:23:49 +0200 |
| commit | dae02a90415b3af5ad2f14297e6259641cccef81 (patch) | |
| tree | 50a40f2ea7eef14f39eda16a70e9494296492f57 /modules | |
| parent | c5da28f24cbab915098165b13f50bcda049e273e (diff) | |
| parent | f5b3b24c22186f50b3e57fc162ef9790f288c704 (diff) | |
| download | godot-dae02a90415b3af5ad2f14297e6259641cccef81.tar.gz godot-dae02a90415b3af5ad2f14297e6259641cccef81.tar.zst godot-dae02a90415b3af5ad2f14297e6259641cccef81.zip | |
Diffstat (limited to 'modules')
| -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 f386f2b54..39f5ec537 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 93a9bac11..11856e4ff 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 18d51daeb..19dd03063 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 96f213ead..5095b7a83 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 e980e40e8..178afec64 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') |
