summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/detect.py14
-rw-r--r--platform/android/export/export.cpp38
-rw-r--r--platform/javascript/detect.py8
-rw-r--r--platform/server/detect.py1
-rw-r--r--platform/x11/detect.py1
5 files changed, 33 insertions, 29 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/android/export/export.cpp b/platform/android/export/export.cpp
index 4735a91f43..88a5554eef 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -531,9 +531,9 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) {
Vector<String> string_table;
- printf("stirng block len: %i\n",string_block_len);
- printf("stirng count: %i\n",string_count);
- printf("flags: %x\n",string_flags);
+ //printf("stirng block len: %i\n",string_block_len);
+ //printf("stirng count: %i\n",string_count);
+ //printf("flags: %x\n",string_flags);
for(uint32_t i=0;i<string_count;i++) {
@@ -617,7 +617,7 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) {
p_manifest=ret;
- printf("end\n");
+ //printf("end\n");
}
String EditorExportPlatformAndroid::get_project_name() const {
@@ -778,16 +778,16 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
else
nspace="";
- printf("ATTR %i NSPACE: %i\n",i,attr_nspace);
- printf("ATTR %i NAME: %i (%s)\n",i,attr_name,attrname.utf8().get_data());
- printf("ATTR %i VALUE: %i (%s)\n",i,attr_value,value.utf8().get_data());
- printf("ATTR %i FLAGS: %x\n",i,attr_flags);
- printf("ATTR %i RESID: %x\n",i,attr_resid);
+ //printf("ATTR %i NSPACE: %i\n",i,attr_nspace);
+ //printf("ATTR %i NAME: %i (%s)\n",i,attr_name,attrname.utf8().get_data());
+ //printf("ATTR %i VALUE: %i (%s)\n",i,attr_value,value.utf8().get_data());
+ //printf("ATTR %i FLAGS: %x\n",i,attr_flags);
+ //printf("ATTR %i RESID: %x\n",i,attr_resid);
//replace project information
if (tname=="manifest" && attrname=="package") {
- print_line("FOUND PACKAGE");
+ print_line("FOUND package");
string_table[attr_value]=get_package_name();
}
@@ -796,14 +796,14 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
//print_line("attrname: "+attrname);
if (tname=="manifest" && /*nspace=="android" &&*/ attrname=="versionCode") {
- print_line("FOUND versioncode");
+ print_line("FOUND versionCode");
encode_uint32(version_code,&p_manifest[iofs+16]);
}
if (tname=="manifest" && /*nspace=="android" &&*/ attrname=="versionName") {
- print_line("FOUND versionname");
+ print_line("FOUND versionName");
if (attr_value==0xFFFFFFFF) {
WARN_PRINT("Version name in a resource, should be plaintext")
} else
@@ -834,10 +834,10 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
} else if (value.begins_with("godot.")) {
String perm = value.get_slice(".",1);
- print_line("PERM: "+perm+" HAS: "+itos(perms.has(perm)));
if (perms.has(perm) || (p_give_internet && perm=="INTERNET")) {
+ print_line("PERM: "+perm);
string_table[attr_value]="android.permission."+perm;
}
@@ -871,12 +871,12 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
} break;
}
- printf("chunk %x: size: %d\n",chunk,size);
+ //printf("chunk %x: size: %d\n",chunk,size);
ofs+=size;
}
- printf("end\n");
+ //printf("end\n");
//create new andriodmanifest binary
@@ -893,14 +893,14 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
encode_uint32(ofs,&ret[string_table_begins+i*4]);
ofs+=string_table[i].length()*2+2+2;
- print_line("ofs: "+itos(i)+": "+itos(ofs));
+ //print_line("ofs: "+itos(i)+": "+itos(ofs));
}
ret.resize(ret.size()+ofs);
uint8_t *chars=&ret[ret.size()-ofs];
for(int i=0;i<string_table.size();i++) {
String s = string_table[i];
- print_line("savint string :"+s);
+ //print_line("savint string :"+s);
encode_uint16(s.length(),chars);
chars+=2;
for(int j=0;j<s.length();j++) { //include zero?
@@ -934,7 +934,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
encode_uint32(new_stable_end-8,&ret[12]); //update new string table size
- print_line("file size: "+itos(ret.size()));
+ //print_line("file size: "+itos(ret.size()));
p_manifest=ret;
@@ -949,7 +949,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
header[i]=decode_uint32(&p_manifest[i*4]);
}
- print_line("STO: "+itos(header[3]));
+ //print_line("STO: "+itos(header[3]));
uint32_t st_offset=9*4;
//ERR_FAIL_COND(header[3]!=0x24)
uint32_t string_count=header[4];
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'])
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 4d86ffd376..8bc85f342d 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -76,7 +76,6 @@ def configure(env):
env.ParseConfig('pkg-config libwebp --cflags --libs')
if (env['builtin_freetype'] == 'no'):
- env['builtin_libpng'] = 'no' # Freetype links against libpng
env.ParseConfig('pkg-config freetype2 --cflags --libs')
if (env['builtin_libpng'] == 'no'):
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index d8cd79297e..857b147e14 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -140,7 +140,6 @@ def configure(env):
env.ParseConfig('pkg-config libwebp --cflags --libs')
if (env['builtin_freetype'] == 'no'):
- env['builtin_libpng'] = 'no' # Freetype links against libpng
env.ParseConfig('pkg-config freetype2 --cflags --libs')
if (env['builtin_libpng'] == 'no'):