summaryrefslogtreecommitdiff
path: root/platform/android/detect.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/detect.py')
-rw-r--r--platform/android/detect.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index b031e51d8c..aa48252435 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -27,7 +27,7 @@ def get_opts():
return [
('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)),
('ndk_platform', 'Target platform (android-<api>, e.g. "android-18")', "android-18"),
- EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86')),
+ EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86', 'x86_64')),
BoolVariable('android_neon', 'Enable NEON support (armv7 only)', True),
BoolVariable('android_stl', 'Enable Android STL support (for modules)', True)
]
@@ -94,7 +94,7 @@ def configure(env):
## Architecture
- if env['android_arch'] not in ['armv7', 'armv6', 'arm64v8', 'x86']:
+ if env['android_arch'] not in ['armv7', 'armv6', 'arm64v8', 'x86', 'x86_64']:
env['android_arch'] = 'armv7'
neon_text = ""
@@ -110,6 +110,16 @@ def configure(env):
abi_subpath = "i686-linux-android"
arch_subpath = "x86"
env["x86_libtheora_opt_gcc"] = True
+ if env['android_arch'] == 'x86_64':
+ if get_platform(env["ndk_platform"]) < 21:
+ print("WARNING: android_arch=x86_64 is not supported by ndk_platform lower than android-21; setting ndk_platform=android-21")
+ env["ndk_platform"] = "android-21"
+ env['ARCH'] = 'arch-x86_64'
+ env.extra_suffix = ".x86_64" + env.extra_suffix
+ target_subpath = "x86_64-4.9"
+ abi_subpath = "x86_64-linux-android"
+ arch_subpath = "x86_64"
+ env["x86_libtheora_opt_gcc"] = True
elif env['android_arch'] == 'armv6':
env['ARCH'] = 'arch-arm'
env.extra_suffix = ".armv6" + env.extra_suffix
@@ -233,6 +243,9 @@ def configure(env):
# The NDK adds this if targeting API < 21, so we can drop it when Godot targets it at least
env.Append(CPPFLAGS=['-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())
@@ -282,7 +295,7 @@ def configure(env):
'/toolchains/' + target_subpath + '/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
env.Append(CPPPATH=['#platform/android'])
- env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL', '-DMPC_FIXED_POINT'])
+ env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL'])
env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl'])
# TODO: Move that to opus module's config