diff options
Diffstat (limited to '3rdparty/bx/scripts/toolchain.lua')
-rw-r--r-- | 3rdparty/bx/scripts/toolchain.lua | 119 |
1 files changed, 66 insertions, 53 deletions
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua index 03f97089b7b..18eeb91a832 100644 --- a/3rdparty/bx/scripts/toolchain.lua +++ b/3rdparty/bx/scripts/toolchain.lua @@ -1,5 +1,5 @@ -- --- Copyright 2010-2018 Branimir Karadzic. All rights reserved. +-- Copyright 2010-2019 Branimir Karadzic. All rights reserved. -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause -- @@ -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" }, @@ -73,6 +74,7 @@ function toolchain(_buildDir, _libDir) { "orbis", "Orbis" }, { "riscv", "RISC-V" }, { "rpi", "RaspberryPi" }, + { "haiku", "Haiku" }, }, } @@ -193,7 +195,9 @@ function toolchain(_buildDir, _libDir) end flags { + "Cpp14", "ExtraWarnings", + "FloatFast", } if _ACTION == "gmake" or _ACTION == "ninja" then @@ -218,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") @@ -228,18 +247,19 @@ function toolchain(_buildDir, _libDir) premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang" premake.gcc.cxx = "$(ANDROID_NDK_CLANG)/bin/clang++" + premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar" premake.gcc.llvm = true location (path.join(_buildDir, "projects", _ACTION .. "-android-x86")) elseif "asmjs" == _OPTIONS["gcc"] then - if not os.getenv("EMSCRIPTEN") then - print("Set EMSCRIPTEN environment variable.") + if not os.getenv("EMSDK") then + print("Set EMSDK environment variable.") end - premake.gcc.cc = "\"$(EMSCRIPTEN)/emcc\"" - premake.gcc.cxx = "\"$(EMSCRIPTEN)/em++\"" - premake.gcc.ar = "\"$(EMSCRIPTEN)/emar\"" + premake.gcc.cc = "\"$(EMSDK)/fastcomp/bin/emcc\"" + premake.gcc.cxx = "\"$(EMSDK)/fastcomp/bin/em++\"" + premake.gcc.ar = "\"$(EMSDK)/fastcomp/bin/emar\"" premake.gcc.llvm = true location (path.join(_buildDir, "projects", _ACTION .. "-asmjs")) @@ -391,6 +411,7 @@ function toolchain(_buildDir, _libDir) or _ACTION == "vs2013" or _ACTION == "vs2015" or _ACTION == "vs2017" + or _ACTION == "vs2019" then local action = premake.action.current() @@ -633,9 +654,6 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } - buildoptions_cpp { - "-std=c++14", - } linkoptions { "-Wl,--gc-sections", "-static", @@ -664,9 +682,9 @@ function toolchain(_buildDir, _libDir) configuration { "mingw-clang" } buildoptions { - "-isystem$(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++", - "-isystem$(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32", - "-isystem$(MINGW)/x86_64-w64-mingw32/include", + "-isystem $(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++", + "-isystem $(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32", + "-isystem $(MINGW)/x86_64-w64-mingw32/include", } linkoptions { "-Qunused-arguments", @@ -722,9 +740,6 @@ function toolchain(_buildDir, _libDir) "-Wundef", -- "-Wuseless-cast", } - buildoptions_cpp { - "-std=c++14", - } links { "rt", "dl", @@ -779,9 +794,6 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } - buildoptions_cpp { - "-std=c++14", - } links { "rt", "dl", @@ -798,9 +810,6 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } - buildoptions_cpp { - "-std=c++14", - } links { "rt", "dl", @@ -840,9 +849,6 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } - buildoptions_cpp { - "-std=c++14", - } linkoptions { "-no-canonical-prefixes", "-Wl,--no-undefined", @@ -860,7 +866,6 @@ function toolchain(_buildDir, _libDir) "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it. } buildoptions { - "-std=c++14", "-Wfatal-errors", "-Wunused-value", "-Wundef", @@ -905,6 +910,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")) @@ -939,15 +971,10 @@ function toolchain(_buildDir, _libDir) objdir (path.join(_buildDir, "asmjs/obj")) libdirs { path.join(_libDir, "lib/asmjs") } buildoptions { - "-i\"system$(EMSCRIPTEN)/system/include\"", - "-i\"system$(EMSCRIPTEN)/system/include/libcxx\"", - "-i\"system$(EMSCRIPTEN)/system/include/libc\"", + "-isystem \"$(EMSDK)/fastcomp/emscripten\"", "-Wunused-value", "-Wundef", } - buildoptions_cpp { - "-std=c++14", - } configuration { "freebsd" } targetdir (path.join(_buildDir, "freebsd/bin")) @@ -1005,12 +1032,6 @@ function toolchain(_buildDir, _libDir) objdir (path.join(_buildDir, "osx_universal/bin")) configuration { "osx" } - buildoptions_cpp { - "-std=c++14", - } - buildoptions_objcpp { - "-std=c++14", - } buildoptions { "-Wfatal-errors", "-msse2", @@ -1023,12 +1044,6 @@ function toolchain(_buildDir, _libDir) linkoptions { "-lc++", } - buildoptions_cpp { - "-std=c++14", - } - buildoptions_objcpp { - "-std=c++14", - } buildoptions { "-Wfatal-errors", "-Wunused-value", @@ -1073,6 +1088,7 @@ function toolchain(_buildDir, _libDir) buildoptions { "-miphoneos-version-min=7.0", "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk", + "-fembed-bitcode", } configuration { "ios-simulator" } @@ -1171,9 +1187,6 @@ function toolchain(_buildDir, _libDir) "$(SCE_ORBIS_SDK_DIR)/target/include", "$(SCE_ORBIS_SDK_DIR)/target/include_common", } - buildoptions_cpp { - "-std=c++14", - } configuration { "rpi" } targetdir (path.join(_buildDir, "rpi/bin")) @@ -1190,9 +1203,6 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } - buildoptions_cpp { - "-std=c++14", - } includedirs { "/opt/vc/include", "/opt/vc/include/interface/vcos/pthreads", @@ -1222,9 +1232,6 @@ function toolchain(_buildDir, _libDir) "-Wundef", "--sysroot=$(FREEDOM_E_SDK)/work/build/riscv-gnu-toolchain/riscv64-unknown-elf/prefix/riscv64-unknown-elf", } - buildoptions_cpp { - "-std=c++14", - } configuration {} -- reset configuration @@ -1239,6 +1246,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.", @@ -1266,7 +1279,7 @@ function strip() configuration { "asmjs" } postbuildcommands { "$(SILENT) echo Running asmjs finalize.", - "$(SILENT) \"$(EMSCRIPTEN)/emcc\" -O2 " + "$(SILENT) \"$(EMSDK)/fastcomp/bin/emcc\" -O2 " -- .. "-s ALLOW_MEMORY_GROWTH=1 " -- .. "-s ASSERTIONS=2 " |