summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/detect.py50
-rw-r--r--platform/android/export/export.cpp6
-rw-r--r--platform/android/java/AndroidManifest.xml7
-rw-r--r--platform/android/java/build.gradle6
4 files changed, 32 insertions, 37 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 5623274050..8d35617d20 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -150,19 +150,21 @@ def configure(env):
if (env["target"].startswith("release")):
if (env["optimize"] == "speed"): #optimize for speed (default)
env.Append(LINKFLAGS=['-O2'])
- env.Append(CPPFLAGS=['-O2', '-DNDEBUG', '-fomit-frame-pointer'])
+ env.Append(CCFLAGS=['-O2', '-fomit-frame-pointer'])
+ env.Append(CPPFLAGS=['-DNDEBUG'])
else: #optimize for size
- env.Append(CPPFLAGS=['-Os', '-DNDEBUG'])
+ env.Append(CCFLAGS=['-Os'])
+ env.Append(CPPFLAGS=['-DNDEBUG'])
env.Append(LINKFLAGS=['-Os'])
if (can_vectorize):
- env.Append(CPPFLAGS=['-ftree-vectorize'])
+ env.Append(CCFLAGS=['-ftree-vectorize'])
if (env["target"] == "release_debug"):
env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])
elif (env["target"] == "debug"):
env.Append(LINKFLAGS=['-O0'])
- env.Append(CPPFLAGS=['-O0', '-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED',
- '-DDEBUG_MEMORY_ENABLED', '-g', '-fno-limit-debug-info'])
+ env.Append(CCFLAGS=['-O0', '-g', '-fno-limit-debug-info'])
+ env.Append(CPPFLAGS=['-D_DEBUG', '-UNDEBUG', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
## Compiler configuration
@@ -216,15 +218,16 @@ def configure(env):
if env['android_stl']:
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/include"])
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++abi/include"])
- env.Append(CXXFLAGS=['-frtti',"-std=gnu++14"])
+ env.Append(CXXFLAGS=['-frtti', "-std=gnu++14"])
else:
- env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions', '-DNO_SAFE_CAST'])
+ env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions'])
+ env.Append(CPPFLAGS=['-DNO_SAFE_CAST'])
ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"])
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"):
print("Using NDK unified headers")
sysroot = env["ANDROID_NDK_ROOT"] + "/sysroot"
- env.Append(CPPFLAGS=["--sysroot="+sysroot])
+ env.Append(CPPFLAGS=["--sysroot=" + sysroot])
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath])
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/android/support/include"])
# For unified headers this define has to be set manually
@@ -233,48 +236,51 @@ def configure(env):
print("Using NDK deprecated headers")
env.Append(CPPFLAGS=["-isystem", lib_sysroot + "/usr/include"])
- env.Append(CPPFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split())
+ env.Append(CCFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split())
env.Append(CPPFLAGS='-DNO_STATVFS -DGLES_ENABLED'.split())
env['neon_enabled'] = False
if env['android_arch'] == 'x86':
target_opts = ['-target', 'i686-none-linux-android']
# The NDK adds this if targeting API < 21, so we can drop it when Godot targets it at least
- env.Append(CPPFLAGS=['-mstackrealign'])
+ env.Append(CCFLAGS=['-mstackrealign'])
elif env['android_arch'] == 'x86_64':
target_opts = ['-target', 'x86_64-none-linux-android']
elif env["android_arch"] == "armv6":
target_opts = ['-target', 'armv6-none-linux-androideabi']
- env.Append(CPPFLAGS='-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'.split())
+ env.Append(CCFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=softfp'.split())
+ env.Append(CPPFLAGS=['-D__ARM_ARCH_6__'])
elif env["android_arch"] == "armv7":
target_opts = ['-target', 'armv7-none-linux-androideabi']
- env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'.split())
+ env.Append(CCFLAGS='-march=armv7-a -mfloat-abi=softfp'.split())
+ env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__'.split())
if env['android_neon']:
env['neon_enabled'] = True
- env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__'])
+ env.Append(CCFLAGS=['-mfpu=neon'])
+ env.Append(CPPFLAGS=['-D__ARM_NEON__'])
else:
- env.Append(CPPFLAGS=['-mfpu=vfpv3-d16'])
+ env.Append(CCFLAGS=['-mfpu=vfpv3-d16'])
elif env["android_arch"] == "arm64v8":
target_opts = ['-target', 'aarch64-none-linux-android']
+ env.Append(CCFLAGS=['-mfix-cortex-a53-835769'])
env.Append(CPPFLAGS=['-D__ARM_ARCH_8A__'])
- env.Append(CPPFLAGS=['-mfix-cortex-a53-835769'])
- env.Append(CPPFLAGS=target_opts)
- env.Append(CPPFLAGS=common_opts)
+ env.Append(CCFLAGS=target_opts)
+ env.Append(CCFLAGS=common_opts)
## Link flags
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"):
if LooseVersion(ndk_version) >= LooseVersion("17.1.4828580"):
- env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a','-Wl,--exclude-libs,libatomic.a','-nostdlib++'])
+ env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a', '-Wl,--exclude-libs,libatomic.a', '-nostdlib++'])
else:
- env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/libandroid_support.a"])
+ env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libandroid_support.a"])
env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel'])
- env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/"])
- env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/"+arch_subpath+"/libc++_shared.so"])
+ env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/"])
+ env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libc++_shared.so"])
else:
env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel'])
if mt_link:
@@ -293,7 +299,7 @@ def configure(env):
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] +
'/toolchains/' + target_subpath + '/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
- env.Append(CPPPATH=['#platform/android'])
+ env.Prepend(CPPPATH=['#platform/android'])
env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL'])
env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl'])
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index f70cee2964..f45644f1eb 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1735,8 +1735,8 @@ public:
new_file += l + "\n";
} else {
String base = l.substr(0, last_tag_pos + last_tag.length());
- if (manifest_sections.has("application_tags")) {
- for (List<String>::Element *E = manifest_sections["application_tags"].front(); E; E = E->next()) {
+ if (manifest_sections.has("application_attribs")) {
+ for (List<String>::Element *E = manifest_sections["application_attribs"].front(); E; E = E->next()) {
String to_add = E->get().strip_edges();
base += " " + to_add + " ";
}
@@ -1864,7 +1864,6 @@ public:
return ERR_FILE_NOT_FOUND;
}
- ERR_FAIL_COND_V(!pkg, ERR_CANT_OPEN);
int ret = unzGoToFirstFile(pkg);
zlib_filefunc_def io2 = io;
@@ -2204,7 +2203,6 @@ public:
return ERR_FILE_NOT_FOUND;
}
- ERR_FAIL_COND_V(!tmp_unaligned, ERR_CANT_OPEN);
ret = unzGoToFirstFile(tmp_unaligned);
io2 = io;
diff --git a/platform/android/java/AndroidManifest.xml b/platform/android/java/AndroidManifest.xml
index 29ddd844ba..613d24fbd2 100644
--- a/platform/android/java/AndroidManifest.xml
+++ b/platform/android/java/AndroidManifest.xml
@@ -43,13 +43,6 @@
<!--Custom application XML added by add-ons-->
<!--CHUNK_APPLICATION_BEGIN-->
-<activity android:name="com.google.android.gms.ads.AdActivity"
- android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
-<meta-data android:name="com.google.android.gms.version"
- android:value="@integer/google_play_services_version" />
-<meta-data
- android:name="com.google.android.gms.ads.AD_MANAGER_APP"
- android:value="true"/>
<!--CHUNK_APPLICATION_END-->
</application>
diff --git a/platform/android/java/build.gradle b/platform/android/java/build.gradle
index 868bbee831..c468277daa 100644
--- a/platform/android/java/build.gradle
+++ b/platform/android/java/build.gradle
@@ -10,8 +10,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
-//CHUNK_BUILD_DEPENDENCIES_BEGIN
-//CHUNK_BUILD_DEPENDENCIES_END
+//CHUNK_BUILDSCRIPT_DEPENDENCIES_BEGIN
+//CHUNK_BUILDSCRIPT_DEPENDENCIES_END
}
}
@@ -31,7 +31,6 @@ allprojects {
dependencies {
implementation "com.android.support:support-core-utils:28.0.0"
//CHUNK_DEPENDENCIES_BEGIN
-compile ('com.google.android.gms:play-services-ads:16.0.0') { exclude group: 'com.android.support' }
//CHUNK_DEPENDENCIES_END
}
@@ -66,7 +65,6 @@ android {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src'
//DIR_SRC_BEGIN
-,'/home/red/coding/godot-demos/2d/platformer/android/admob/src'
//DIR_SRC_END
]
res.srcDirs = [