diff options
author | 2016-06-04 00:23:54 -0500 | |
---|---|---|
committer | 2016-06-04 00:34:43 -0500 | |
commit | 2e8521cde0b90d80a510be594a2124079edfea27 (patch) | |
tree | 54c59cb052695200e7b5ae4e14285fb2399ef85b /scripts | |
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')
-rw-r--r-- | scripts/src/osd/sdl.lua | 12 | ||||
-rw-r--r-- | scripts/toolchain.lua | 59 |
2 files changed, 32 insertions, 39 deletions
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index d1a83229698..7766b69873d 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -239,7 +239,7 @@ elseif _OPTIONS["targetos"]=="macosx" then SDL_NETWORK = "pcap" end -if _OPTIONS["with-bundled-sdl2"]~=nil or _OPTIONS["targetos"]=="android" then +if _OPTIONS["with-bundled-sdl2"]~=nil then includedirs { GEN_DIR .. "includes", } @@ -295,10 +295,12 @@ if BASE_TARGETOS=="unix" then "/usr/openwin/lib", } end - if _OPTIONS["with-bundled-sdl2"]~=nil and _OPTIONS["targetos"]~="android" then - links { - "SDL2", - } + if _OPTIONS["with-bundled-sdl2"]~=nil then + if _OPTIONS["targetos"]~="android" then + links { + "SDL2", + } + end else local str = backtick(sdlconfigcmd() .. " --libs") addlibfromstring(str) 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 |