|
|
@@ -50,6 +50,7 @@ function toolchain(_buildDir, _libDir)
|
|
|
description = "Choose GCC flavor",
|
|
|
allowed = {
|
|
|
{ "android-arm", "Android - ARM" },
|
|
|
+ { "android-arm64", "Android - ARM64" },
|
|
|
{ "android-x86", "Android - x86" },
|
|
|
{ "asmjs", "Emscripten/asm.js" },
|
|
|
{ "freebsd", "FreeBSD" },
|
|
|
@@ -221,6 +222,21 @@ function toolchain(_buildDir, _libDir)
|
|
|
premake.gcc.llvm = true
|
|
|
location (path.join(_buildDir, "projects", _ACTION .. "-android-arm"))
|
|
|
|
|
|
+ elseif "android-arm64" == _OPTIONS["gcc"] then
|
|
|
+
|
|
|
+ if not os.getenv("ANDROID_NDK_ARM64")
|
|
|
+ or not os.getenv("ANDROID_NDK_CLANG")
|
|
|
+ or not os.getenv("ANDROID_NDK_ROOT") then
|
|
|
+ print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM64, and ANDROID_NDK_ROOT environment variables.")
|
|
|
+ end
|
|
|
+
|
|
|
+ premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang"
|
|
|
+ premake.gcc.cxx = "$(ANDROID_NDK_CLANG)/bin/clang++"
|
|
|
+ premake.gcc.ar = "$(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-ar"
|
|
|
+
|
|
|
+ premake.gcc.llvm = true
|
|
|
+ location (path.join(_buildDir, "projects", _ACTION .. "-android-arm64"))
|
|
|
+
|
|
|
elseif "android-x86" == _OPTIONS["gcc"] then
|
|
|
|
|
|
if not os.getenv("ANDROID_NDK_X86")
|
|
|
@@ -893,6 +909,33 @@ function toolchain(_buildDir, _libDir)
|
|
|
"-Wl,--fix-cortex-a8",
|
|
|
}
|
|
|
|
|
|
+ configuration { "android-arm64" }
|
|
|
+ targetdir (path.join(_buildDir, "android-arm64/bin"))
|
|
|
+ objdir (path.join(_buildDir, "android-arm64/obj"))
|
|
|
+ libdirs {
|
|
|
+ "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/arm64-v8a",
|
|
|
+ }
|
|
|
+ includedirs {
|
|
|
+ "$(ANDROID_NDK_ROOT)/sysroot/usr/include/aarch64-linux-android",
|
|
|
+ }
|
|
|
+ buildoptions {
|
|
|
+ "-gcc-toolchain $(ANDROID_NDK_ARM64)",
|
|
|
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64"),
|
|
|
+ "-target aarch64-none-linux-androideabi",
|
|
|
+ "-march=armv8-a",
|
|
|
+ "-Wunused-value",
|
|
|
+ "-Wundef",
|
|
|
+ }
|
|
|
+ linkoptions {
|
|
|
+ "-gcc-toolchain $(ANDROID_NDK_ARM64)",
|
|
|
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64"),
|
|
|
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64/usr/lib/crtbegin_so.o"),
|
|
|
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64/usr/lib/crtend_so.o"),
|
|
|
+ "-target aarch64-none-linux-androideabi",
|
|
|
+ "-march=armv8-a",
|
|
|
+ "-Wl,--fix-cortex-a8",
|
|
|
+ }
|
|
|
+
|
|
|
configuration { "android-x86" }
|
|
|
targetdir (path.join(_buildDir, "android-x86/bin"))
|
|
|
objdir (path.join(_buildDir, "android-x86/obj"))
|
|
|
@@ -1202,6 +1245,12 @@ function strip()
|
|
|
"$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
|
|
|
}
|
|
|
|
|
|
+ configuration { "android-arm64", "Release" }
|
|
|
+ postbuildcommands {
|
|
|
+ "$(SILENT) echo Stripping symbols.",
|
|
|
+ "$(SILENT) $(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-strip -s \"$(TARGET)\""
|
|
|
+ }
|
|
|
+
|
|
|
configuration { "android-x86", "Release" }
|
|
|
postbuildcommands {
|
|
|
"$(SILENT) echo Stripping symbols.",
|