You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #105611 from m4gr3d/upgrade_android_tools_main
Update the Android NDK to the latest LTS version (r27c)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from misc.utility.scons_hints import *
|
from misc.utility.scons_hints import *
|
||||||
|
|
||||||
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -51,18 +52,34 @@ lib = env_android.add_shared_library("#bin/libgodot", android_objects, redirect_
|
|||||||
env.Depends(lib, thirdparty_obj)
|
env.Depends(lib, thirdparty_obj)
|
||||||
|
|
||||||
lib_arch_dir = ""
|
lib_arch_dir = ""
|
||||||
|
triple_target_dir = ""
|
||||||
if env["arch"] == "arm32":
|
if env["arch"] == "arm32":
|
||||||
lib_arch_dir = "armeabi-v7a"
|
lib_arch_dir = "armeabi-v7a"
|
||||||
|
triple_target_dir = "arm-linux-androideabi"
|
||||||
elif env["arch"] == "arm64":
|
elif env["arch"] == "arm64":
|
||||||
lib_arch_dir = "arm64-v8a"
|
lib_arch_dir = "arm64-v8a"
|
||||||
|
triple_target_dir = "aarch64-linux-android"
|
||||||
elif env["arch"] == "x86_32":
|
elif env["arch"] == "x86_32":
|
||||||
lib_arch_dir = "x86"
|
lib_arch_dir = "x86"
|
||||||
|
triple_target_dir = "i686-linux-android"
|
||||||
elif env["arch"] == "x86_64":
|
elif env["arch"] == "x86_64":
|
||||||
lib_arch_dir = "x86_64"
|
lib_arch_dir = "x86_64"
|
||||||
|
triple_target_dir = "x86_64-linux-android"
|
||||||
else:
|
else:
|
||||||
print_warning("Architecture not suitable for embedding into APK; keeping .so at \\bin")
|
print_warning("Architecture not suitable for embedding into APK; keeping .so at \\bin")
|
||||||
|
|
||||||
if lib_arch_dir != "":
|
host_subpath = ""
|
||||||
|
if sys.platform.startswith("linux"):
|
||||||
|
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"
|
||||||
|
|
||||||
|
if lib_arch_dir != "" and host_subpath != "":
|
||||||
if env.dev_build:
|
if env.dev_build:
|
||||||
lib_type_dir = "dev"
|
lib_type_dir = "dev"
|
||||||
elif env.debug_features:
|
elif env.debug_features:
|
||||||
@@ -81,9 +98,7 @@ if lib_arch_dir != "":
|
|||||||
out_dir = "#platform/android/java/lib/libs/" + lib_tools_dir + lib_type_dir + "/" + lib_arch_dir
|
out_dir = "#platform/android/java/lib/libs/" + lib_tools_dir + lib_type_dir + "/" + lib_arch_dir
|
||||||
env_android.CommandNoCache(out_dir + "/libgodot_android.so", lib, Move("$TARGET", "$SOURCE"))
|
env_android.CommandNoCache(out_dir + "/libgodot_android.so", lib, Move("$TARGET", "$SOURCE"))
|
||||||
|
|
||||||
stl_lib_path = (
|
stl_lib_path = f"{env['ANDROID_NDK_ROOT']}/toolchains/llvm/prebuilt/{host_subpath}/sysroot/usr/lib/{triple_target_dir}/libc++_shared.so"
|
||||||
str(env["ANDROID_NDK_ROOT"]) + "/sources/cxx-stl/llvm-libc++/libs/" + lib_arch_dir + "/libc++_shared.so"
|
|
||||||
)
|
|
||||||
env_android.CommandNoCache(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE"))
|
env_android.CommandNoCache(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE"))
|
||||||
|
|
||||||
def generate_android_binaries(target, source, env):
|
def generate_android_binaries(target, source, env):
|
||||||
@@ -98,10 +113,11 @@ if lib_arch_dir != "":
|
|||||||
else:
|
else:
|
||||||
gradle_process = ["./gradlew"]
|
gradle_process = ["./gradlew"]
|
||||||
|
|
||||||
gradle_process += [
|
if env["target"] == "editor":
|
||||||
"generateGodotEditor" if env["target"] == "editor" else "generateGodotTemplates",
|
gradle_process += ["generateGodotEditor", "generateGodotHorizonOSEditor", "generateGodotPicoOSEditor"]
|
||||||
"--quiet",
|
else:
|
||||||
]
|
gradle_process += ["generateGodotTemplates"]
|
||||||
|
gradle_process += ["--quiet"]
|
||||||
|
|
||||||
if env["gradle_do_not_strip"]:
|
if env["gradle_do_not_strip"]:
|
||||||
gradle_process += ["-PdoNotStrip=true"]
|
gradle_process += ["-PdoNotStrip=true"]
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ def get_android_ndk_root(env: "SConsEnvironment"):
|
|||||||
|
|
||||||
# This is kept in sync with the value in 'platform/android/java/app/config.gradle'.
|
# This is kept in sync with the value in 'platform/android/java/app/config.gradle'.
|
||||||
def get_ndk_version():
|
def get_ndk_version():
|
||||||
return "23.2.8568313"
|
return "27.2.12479018"
|
||||||
|
|
||||||
|
|
||||||
# This is kept in sync with the value in 'platform/android/java/app/config.gradle'.
|
# This is kept in sync with the value in 'platform/android/java/app/config.gradle'.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ ext.versions = [
|
|||||||
nexusPublishVersion: '1.3.0',
|
nexusPublishVersion: '1.3.0',
|
||||||
javaVersion : JavaVersion.VERSION_17,
|
javaVersion : JavaVersion.VERSION_17,
|
||||||
// Also update 'platform/android/detect.py#get_ndk_version()' when this is updated.
|
// Also update 'platform/android/detect.py#get_ndk_version()' when this is updated.
|
||||||
ndkVersion : '23.2.8568313',
|
ndkVersion : '27.2.12479018',
|
||||||
splashscreenVersion: '1.0.1',
|
splashscreenVersion: '1.0.1',
|
||||||
openxrVendorsVersion: '3.1.2-stable'
|
openxrVendorsVersion: '3.1.2-stable'
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,11 @@ afterEvaluate {
|
|||||||
name = 'Rémi Verschelde'
|
name = 'Rémi Verschelde'
|
||||||
email = 'rverschelde@gmail.com'
|
email = 'rverschelde@gmail.com'
|
||||||
}
|
}
|
||||||
// Add all other devs here...
|
developer {
|
||||||
|
id = 'godotengine'
|
||||||
|
name = 'Godot Engine contributors'
|
||||||
|
email = 'contact@godotengine.org'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version control info - if you're using GitHub, follow the
|
// Version control info - if you're using GitHub, follow the
|
||||||
@@ -91,7 +95,11 @@ afterEvaluate {
|
|||||||
name = 'Rémi Verschelde'
|
name = 'Rémi Verschelde'
|
||||||
email = 'rverschelde@gmail.com'
|
email = 'rverschelde@gmail.com'
|
||||||
}
|
}
|
||||||
// Add all other devs here...
|
developer {
|
||||||
|
id = 'godotengine'
|
||||||
|
name = 'Godot Engine contributors'
|
||||||
|
email = 'contact@godotengine.org'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version control info - if you're using GitHub, follow the
|
// Version control info - if you're using GitHub, follow the
|
||||||
|
|||||||
Reference in New Issue
Block a user