summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/detect.py14
-rw-r--r--platform/javascript/detect.py8
2 files changed, 14 insertions, 8 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 7f197895f1..d1073e0c7b 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -130,18 +130,17 @@ def configure(env):
else:
env.extra_suffix = ".armv7" + env.extra_suffix
+ mt_link = True
if (sys.platform.startswith("linux")):
- if (platform.machine().endswith('64')):
- host_subpath = "linux-x86_64"
- else:
- host_subpath = "linux-x86"
+ host_subpath = "linux-x86_64"
elif (sys.platform.startswith("darwin")):
host_subpath = "darwin-x86_64"
elif (sys.platform.startswith('win')):
if (platform.machine().endswith('64')):
host_subpath = "windows-x86_64"
else:
- host_subpath = "windows-x86"
+ mt_link = False
+ host_subpath = "windows"
compiler_path = env["ANDROID_NDK_ROOT"] + \
"/toolchains/llvm/prebuilt/" + host_subpath + "/bin"
@@ -205,14 +204,15 @@ def configure(env):
env['SHLIBSUFFIX'] = '.so'
env['LINKFLAGS'] = ['-shared', '--sysroot=' +
- sysroot, '-Wl,--warn-shared-textrel',
- '-Wl,--threads']
+ sysroot, '-Wl,--warn-shared-textrel']
env.Append(LINKFLAGS=string.split(
'-Wl,--fix-cortex-a8'))
env.Append(LINKFLAGS=string.split(
'-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now'))
env.Append(LINKFLAGS=string.split(
'-Wl,-soname,libgodot_android.so -Wl,--gc-sections'))
+ if mt_link:
+ env.Append(LINKFLAGS=['-Wl,--threads'])
env.Append(LINKFLAGS=target_opts)
env.Append(LINKFLAGS=common_opts)
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index 9bc204a94a..35352becf8 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -76,6 +76,7 @@ def configure(env):
if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
env.opus_fixed_point = "yes"
+ # These flags help keep the file size down
env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti'])
env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL', '-DMPC_FIXED_POINT', '-DTYPED_METHOD_BIND', '-DNO_THREADS'])
env.Append(CPPFLAGS=['-DGLES2_ENABLED'])
@@ -85,7 +86,12 @@ def configure(env):
if env['wasm'] == 'yes':
env.Append(LINKFLAGS=['-s', 'BINARYEN=1'])
- env.Append(LINKFLAGS=['-s', '\'BINARYEN_METHOD="native-wasm"\''])
+ # Maximum memory size is baked into the WebAssembly binary during
+ # compilation, so we need to enable memory growth to allow setting
+ # TOTAL_MEMORY at runtime. The value set at runtime must be higher than
+ # what is set during compilation, check TOTAL_MEMORY in Emscripten's
+ # src/settings.js for the default.
+ env.Append(LINKFLAGS=['-s', 'ALLOW_MEMORY_GROWTH=1'])
env["PROGSUFFIX"] += ".webassembly"
else:
env.Append(CPPFLAGS=['-s', 'ASM_JS=1'])