diff options
author | 2016-06-04 00:23:54 -0500 | |
---|---|---|
committer | 2016-06-04 00:34:43 -0500 | |
commit | 2e8521cde0b90d80a510be594a2124079edfea27 (patch) | |
tree | 54c59cb052695200e7b5ae4e14285fb2399ef85b /scripts/toolchain.lua | |
parent | 109e7fffd0c76f3140c508a9f2ab04023b8439a5 (diff) |
fix android target libSDL2 circular ref (nw)
also rename ANDROID_NDK_ROOT -> ANDROID_NDK_LLVM to point directly to
prebuilt host compiler (removes windows only restriction).
Diffstat (limited to 'scripts/toolchain.lua')
-rw-r--r-- | scripts/toolchain.lua | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 23429e52602..d94b8abddec 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -114,80 +114,71 @@ function toolchain(_buildDir, _subDir) os.exit(1) end - if "android-arm" == _OPTIONS["gcc"] then + if string.find(_OPTIONS["gcc"], "android") then + if not os.getenv("ANDROID_NDK_LLVM") then + print("Set ANDROID_NDK_LLVM envrionment variables.") + end + + premake.gcc.cc = "$(ANDROID_NDK_LLVM)/bin/clang" + premake.gcc.cxx = "$(ANDROID_NDK_LLVM)/bin/clang++" + premake.gcc.llvm = true + end - if not os.getenv("ANDROID_NDK_ARM") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_ARM and ANDROID_NDK_ROOT envrionment variables.") + if "android-arm" == _OPTIONS["gcc"] then + if not os.getenv("ANDROID_NDK_ARM") then + print("Set ANDROID_NDK_ARM envrionment variables.") end - premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" - premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar" - premake.gcc.llvm = true location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-arm") end if "android-arm64" == _OPTIONS["gcc"] then - - if not os.getenv("ANDROID_NDK_ARM64") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_ARM64 and ANDROID_NDK_ROOT envrionment variables.") + if not os.getenv("ANDROID_NDK_ARM64") then + print("Set ANDROID_NDK_ARM64 envrionment variables.") end - premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" - premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" - premake.gcc.ar = "$(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-ar.exe" + premake.gcc.ar = "$(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-ar" premake.gcc.llvm = true location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-arm64") end if "android-mips" == _OPTIONS["gcc"] then - - if not os.getenv("ANDROID_NDK_MIPS") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_MIPS and ANDROID_NDK_ROOT envrionment variables.") + if not os.getenv("ANDROID_NDK_MIPS") then + print("Set ANDROID_NDK_MIPS envrionment variables.") end - premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" - premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" premake.gcc.ar = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-ar" premake.gcc.llvm = true location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-mips") end if "android-mips64" == _OPTIONS["gcc"] then - - if not os.getenv("ANDROID_NDK_MIPS64") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_MIPS64 and ANDROID_NDK_ROOT envrionment variables.") + if not os.getenv("ANDROID_NDK_MIPS64") then + print("Set ANDROID_NDK_MIPS64 envrionment variables.") end - premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" - premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" - premake.gcc.ar = "$(ANDROID_NDK_MIPS64)/bin/mips64el-linux-android-ar.exe" + premake.gcc.ar = "$(ANDROID_NDK_MIPS64)/bin/mips64el-linux-android-ar" premake.gcc.llvm = true location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-mips64") end if "android-x86" == _OPTIONS["gcc"] then - - if not os.getenv("ANDROID_NDK_X86") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_X86 and ANDROID_NDK_ROOT envrionment variables.") + if not os.getenv("ANDROID_NDK_X86") then + print("Set ANDROID_NDK_X86 envrionment variables.") end - premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" - premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar" premake.gcc.llvm = true location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-x86") end if "android-x64" == _OPTIONS["gcc"] then - - if not os.getenv("ANDROID_NDK_X64") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_X64 and ANDROID_NDK_ROOT envrionment variables.") + if not os.getenv("ANDROID_NDK_X64") then + print("Set ANDROID_NDK_X64 envrionment variables.") end - premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" - premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" - premake.gcc.ar = "$(ANDROID_NDK_X64)/bin/x86_64-linux-android-ar.exe" + premake.gcc.ar = "$(ANDROID_NDK_X64)/bin/x86_64-linux-android-ar" premake.gcc.llvm = true location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-x64") end |