You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Fixed android arm64v8
This commit is contained in:
committed by
Xavier Sellier
parent
2085bcce3b
commit
ff3cb321da
@@ -16,6 +16,10 @@ def can_build():
|
|||||||
return ("ANDROID_NDK_ROOT" in os.environ)
|
return ("ANDROID_NDK_ROOT" in os.environ)
|
||||||
|
|
||||||
|
|
||||||
|
def get_platform(platform):
|
||||||
|
return int(platform.split("-")[1])
|
||||||
|
|
||||||
|
|
||||||
def get_opts():
|
def get_opts():
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@@ -128,6 +132,9 @@ def configure(env):
|
|||||||
else:
|
else:
|
||||||
env.extra_suffix = ".armv7" + env.extra_suffix
|
env.extra_suffix = ".armv7" + env.extra_suffix
|
||||||
elif env["android_arch"] == "arm64v8":
|
elif env["android_arch"] == "arm64v8":
|
||||||
|
if get_platform(env["ndk_platform"]) < 21:
|
||||||
|
print("WARNING: android_arch=arm64v8 is not supported by ndk_platform lower than andorid-21; setting ndk_platform=android-21")
|
||||||
|
env["ndk_platform"] = "android-21"
|
||||||
env['ARCH'] = 'arch-arm64'
|
env['ARCH'] = 'arch-arm64'
|
||||||
target_subpath = "aarch64-linux-android-4.9"
|
target_subpath = "aarch64-linux-android-4.9"
|
||||||
abi_subpath = "aarch64-linux-android"
|
abi_subpath = "aarch64-linux-android"
|
||||||
@@ -149,10 +156,8 @@ def configure(env):
|
|||||||
if env["android_arch"] == "arm64v8":
|
if env["android_arch"] == "arm64v8":
|
||||||
mt_link = False
|
mt_link = False
|
||||||
|
|
||||||
compiler_path = env["ANDROID_NDK_ROOT"] + \
|
compiler_path = env["ANDROID_NDK_ROOT"] + "/toolchains/llvm/prebuilt/" + host_subpath + "/bin"
|
||||||
"/toolchains/llvm/prebuilt/" + host_subpath + "/bin"
|
gcc_toolchain_path = env["ANDROID_NDK_ROOT"] + "/toolchains/" + target_subpath + "/prebuilt/" + host_subpath
|
||||||
gcc_toolchain_path = env["ANDROID_NDK_ROOT"] + \
|
|
||||||
"/toolchains/" + target_subpath + "/prebuilt/" + host_subpath
|
|
||||||
tools_path = gcc_toolchain_path + "/" + abi_subpath + "/bin"
|
tools_path = gcc_toolchain_path + "/" + abi_subpath + "/bin"
|
||||||
|
|
||||||
# For Clang to find NDK tools in preference of those system-wide
|
# For Clang to find NDK tools in preference of those system-wide
|
||||||
@@ -182,7 +187,7 @@ def configure(env):
|
|||||||
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"])
|
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"])
|
||||||
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath])
|
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath])
|
||||||
# For unified headers this define has to be set manually
|
# For unified headers this define has to be set manually
|
||||||
env.Append(CPPFLAGS=["-D__ANDROID_API__=" + str(int(ndk_platform.split("-")[1]))])
|
env.Append(CPPFLAGS=["-D__ANDROID_API__=" + str(get_platform(env['ndk_platform']))])
|
||||||
else:
|
else:
|
||||||
print("Using NDK deprecated headers")
|
print("Using NDK deprecated headers")
|
||||||
env.Append(CPPFLAGS=["-isystem", lib_sysroot + "/usr/include"])
|
env.Append(CPPFLAGS=["-isystem", lib_sysroot + "/usr/include"])
|
||||||
@@ -237,10 +242,10 @@ def configure(env):
|
|||||||
env.Append(LINKFLAGS=target_opts)
|
env.Append(LINKFLAGS=target_opts)
|
||||||
env.Append(LINKFLAGS=common_opts)
|
env.Append(LINKFLAGS=common_opts)
|
||||||
|
|
||||||
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + '/toolchains/arm-linux-androideabi-4.9/prebuilt/' +
|
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + '/toolchains/' + target_subpath + '/prebuilt/' +
|
||||||
host_subpath + '/lib/gcc/' + abi_subpath + '/4.9.x'])
|
host_subpath + '/lib/gcc/' + abi_subpath + '/4.9.x'])
|
||||||
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] +
|
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] +
|
||||||
'/toolchains/arm-linux-androideabi-4.9/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
|
'/toolchains/' + target_subpath + '/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
|
||||||
|
|
||||||
if (env["target"].startswith("release")):
|
if (env["target"].startswith("release")):
|
||||||
env.Append(LINKFLAGS=['-O2'])
|
env.Append(LINKFLAGS=['-O2'])
|
||||||
|
|||||||
Reference in New Issue
Block a user