diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/os_android.cpp | 11 | ||||
-rw-r--r-- | platform/android/os_android.h | 2 | ||||
-rw-r--r-- | platform/javascript/SCsub | 11 | ||||
-rw-r--r-- | platform/server/detect.py | 10 | ||||
-rw-r--r-- | platform/x11/detect.py | 10 |
5 files changed, 38 insertions, 6 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 23811f963a..67ce796279 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -48,6 +48,8 @@ #include "file_access_jandroid.h" #endif +#include <dlfcn.h> + class AndroidLogger : public Logger { public: virtual void logv(const char *p_format, va_list p_list, bool p_err) { @@ -173,6 +175,15 @@ void OS_Android::alert(const String &p_alert, const String &p_title) { alert_func(p_alert, p_title); } +Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { + p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW); + if (!p_library_handle) { + ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror()); + ERR_FAIL_V(ERR_CANT_OPEN); + } + return OK; +} + void OS_Android::set_mouse_show(bool p_show) { //android has no mouse... diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 7ace7b5200..12181b3688 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -159,6 +159,8 @@ public: virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false); + virtual void set_mouse_show(bool p_show); virtual void set_mouse_grab(bool p_grab); virtual bool is_mouse_grab_enabled() const; diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index 05992ebac8..66a8a8d93c 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -23,6 +23,7 @@ env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_main_after_fs_sync' target_dir = env.Dir("#bin") build = env.add_program(['#bin/godot', target_dir.File('godot' + env['PROGSUFFIX'] + '.wasm')], javascript_objects, PROGSUFFIX=env['PROGSUFFIX'] + '.js'); +js, wasm = build js_libraries = [] js_libraries.append(env.File('http_request.js')) @@ -30,12 +31,10 @@ for lib in js_libraries: env.Append(LINKFLAGS=['--js-library', lib.path]) env.Depends(build, js_libraries) -prejs = env.File('pre.js') -postjs = env.File('engine.js') -env.Append(LINKFLAGS=['--pre-js', prejs.path]) -env.Append(LINKFLAGS=['--post-js', postjs.path]) -env.Depends(build, [prejs, postjs]) +wrapper_start = env.File('pre.js') +wrapper_end = env.File('engine.js') +js_final = env.Textfile('#bin/godot', [wrapper_start, js, wrapper_end], TEXTFILESUFFIX=env['PROGSUFFIX'] + '.wrapped.js') zip_dir = target_dir.Dir('.javascript_zip') -zip_files = env.InstallAs([zip_dir.File('godot.js'), zip_dir.File('godot.wasm'), zip_dir.File('godot.html')], build + ['#misc/dist/html/default.html']) +zip_files = env.InstallAs([zip_dir.File('godot.js'), zip_dir.File('godot.wasm'), zip_dir.File('godot.html')], [js_final, wasm, '#misc/dist/html/default.html']) Zip('#bin/godot', zip_files, ZIPSUFFIX=env['PROGSUFFIX'] + env['ZIPSUFFIX'], ZIPROOT=zip_dir, ZIPCOMSTR="Archving $SOURCES as $TARGET") diff --git a/platform/server/detect.py b/platform/server/detect.py index 72c9c770e3..bc90a38e24 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -86,6 +86,16 @@ def configure(env): if not env['builtin_libpng']: env.ParseConfig('pkg-config libpng --cflags --libs') + if not env['builtin_bullet']: + # We need at least version 2.87 + import subprocess + bullet_version = subprocess.check_output(['pkg-config', 'bullet', '--modversion']).strip() + if bullet_version < "2.87": + # Abort as system bullet was requested but too old + print("Bullet: System version {0} does not match minimal requirements ({1}). Aborting.".format(bullet_version, "2.87")) + sys.exit(255) + env.ParseConfig('pkg-config bullet --cflags --libs') + if not env['builtin_enet']: env.ParseConfig('pkg-config libenet --cflags --libs') diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 478b42f9f7..1c6bada815 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -172,6 +172,16 @@ def configure(env): if not env['builtin_libpng']: env.ParseConfig('pkg-config libpng --cflags --libs') + if not env['builtin_bullet']: + # We need at least version 2.87 + import subprocess + bullet_version = subprocess.check_output(['pkg-config', 'bullet', '--modversion']).strip() + if bullet_version < "2.87": + # Abort as system bullet was requested but too old + print("Bullet: System version {0} does not match minimal requirements ({1}). Aborting.".format(bullet_version, "2.87")) + sys.exit(255) + env.ParseConfig('pkg-config bullet --cflags --libs') + if not env['builtin_enet']: env.ParseConfig('pkg-config libenet --cflags --libs') |