From 006bcaa169ce2c581dee47a9e162554dabba5932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Verdon?= Date: Wed, 14 Nov 2018 01:08:37 +0100 Subject: [PATCH] Android ndk 18 (#193) * mips abi is not longer supported by android ndk (deprecated in v17, removed in v18) * Updating toolchain paths for ndk v18 * libc++ filenames were changed to c++_shared and c++_static in the ndk --- scripts/toolchain.lua | 59 ++++--------------------------------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 479b228..12d8de0 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -50,7 +50,6 @@ function toolchain(_buildDir, _libDir) description = "Choose GCC flavor", allowed = { { "android-arm", "Android - ARM" }, - { "android-mips", "Android - MIPS" }, { "android-x86", "Android - x86" }, { "asmjs", "Emscripten/asm.js" }, { "freebsd", "FreeBSD" }, @@ -219,25 +218,12 @@ function toolchain(_buildDir, _libDir) premake.gcc.llvm = true location (path.join(_buildDir, "projects", _ACTION .. "-android-arm")) - elseif "android-mips" == _OPTIONS["gcc"] then - - if not os.getenv("ANDROID_NDK_MIPS") - or not os.getenv("ANDROID_NDK_CLANG") - or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, 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.llvm = true - location (path.join(_buildDir, "projects", _ACTION .. "-android-mips")) - elseif "android-x86" == _OPTIONS["gcc"] then if not os.getenv("ANDROID_NDK_X86") or not os.getenv("ANDROID_NDK_CLANG") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT environment variables.") + print("Set ANDROID_NDK_CLANG, ANDROID_NDK_X86, and ANDROID_NDK_ROOT environment variables.") end premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang" @@ -829,6 +815,7 @@ function toolchain(_buildDir, _libDir) "NoImportLib", } includedirs { + "${ANDROID_NDK_ROOT}/sysroot/usr/include", "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/include", "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue", } @@ -841,7 +828,7 @@ function toolchain(_buildDir, _libDir) "m", "android", "log", - "c++", + "c++_shared", "gcc", } buildoptions { @@ -892,12 +879,10 @@ function toolchain(_buildDir, _libDir) targetdir (path.join(_buildDir, "android-arm/bin")) objdir (path.join(_buildDir, "android-arm/obj")) libdirs { - path.join(_libDir, "lib/android-arm"), "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a", } includedirs { - "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/include", - "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/include", + "$(ANDROID_NDK_ROOT)/sysroot/usr/include/arm-linux-androideabi", } buildoptions { "-gcc-toolchain $(ANDROID_NDK_ARM)", @@ -920,42 +905,14 @@ function toolchain(_buildDir, _libDir) "-Wl,--fix-cortex-a8", } - configuration { "android-mips" } - targetdir (path.join(_buildDir, "android-mips/bin")) - objdir (path.join(_buildDir, "android-mips/obj")) - libdirs { - path.join(_libDir, "lib/android-mips"), - "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/mips", - } - includedirs { - "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/mips/include", - } - buildoptions { - "-gcc-toolchain $(ANDROID_NDK_MIPS)", - "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"), - "-target mipsel-none-linux-android", - "-mips32", - "-Wunused-value", - "-Wundef", - } - linkoptions { - "-gcc-toolchain $(ANDROID_NDK_MIPS)", - "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"), - path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtbegin_so.o"), - path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtend_so.o"), - "-target mipsel-none-linux-android", - "-mips32", - } - configuration { "android-x86" } targetdir (path.join(_buildDir, "android-x86/bin")) objdir (path.join(_buildDir, "android-x86/obj")) libdirs { - path.join(_libDir, "lib/android-x86"), "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/x86", } includedirs { - "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/x86/include", + "$(ANDROID_NDK_ROOT)/sysroot/usr/include/x86_64-linux-android", } buildoptions { "-gcc-toolchain $(ANDROID_NDK_X86)", @@ -1282,12 +1239,6 @@ function strip() "$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\"" } - configuration { "android-mips", "Release" } - postbuildcommands { - "$(SILENT) echo Stripping symbols.", - "$(SILENT) $(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\"" - } - configuration { "android-x86", "Release" } postbuildcommands { "$(SILENT) echo Stripping symbols.",