diff options
author | 2017-03-29 17:09:40 +0200 | |
---|---|---|
committer | 2017-03-29 17:09:40 +0200 | |
commit | 49f7c99c7786ce257fae28dfeae2f8ee5810424c (patch) | |
tree | 1bbd30dd4dd48596186846c2fc77a8dc748215d2 /3rdparty/bx/scripts/toolchain.lua | |
parent | 79f22e060b2c012d628d5d1d83288c1bb6e6acef (diff) |
Update BGFX and BX (nw)
Diffstat (limited to '3rdparty/bx/scripts/toolchain.lua')
-rw-r--r-- | 3rdparty/bx/scripts/toolchain.lua | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua index 6a01c92422c..0152ce79c32 100644 --- a/3rdparty/bx/scripts/toolchain.lua +++ b/3rdparty/bx/scripts/toolchain.lua @@ -6,6 +6,43 @@ local bxDir = path.getabsolute("..") local naclToolchain = "" +local function crtNone() + + defines { + "BX_CRT_NONE=1", + } + + buildoptions { + "-nostdlib", + "-nodefaultlibs", + "-nostartfiles", + "-Wa,--noexecstack", + "-ffreestanding", + } + + linkoptions { + "-nostdlib", + "-nodefaultlibs", + "-nostartfiles", + "-Wa,--noexecstack", + "-ffreestanding", + } + + configuration { "linux-*" } + + buildoptions { + "-mpreferred-stack-boundary=4", + "-mstackrealign", + } + + linkoptions { + "-mpreferred-stack-boundary=4", + "-mstackrealign", + } + + configuration {} +end + function toolchain(_buildDir, _libDir) newoption { @@ -152,6 +189,10 @@ function toolchain(_buildDir, _libDir) compiler32bit = true end + flags { + "ExtraWarnings", + } + if _ACTION == "gmake" or _ACTION == "ninja" then if nil == _OPTIONS["gcc"] then @@ -159,20 +200,18 @@ function toolchain(_buildDir, _libDir) os.exit(1) end - flags { - "ExtraWarnings", - } - if "android-arm" == _OPTIONS["gcc"] then if not os.getenv("ANDROID_NDK_ARM") or not os.getenv("ANDROID_NDK_CLANG") or not os.getenv("ANDROID_NDK_ROOT") then - print("Set ANDROID_NDK_CLANG and ANDROID_NDK_ROOT envrionment variables.") + print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT envrionment variables.") end premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang" premake.gcc.cxx = "$(ANDROID_NDK_CLANG)/bin/clang++" + premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar" + premake.gcc.llvm = true location (path.join(_buildDir, "projects", _ACTION .. "-android-arm")) @@ -181,7 +220,7 @@ function toolchain(_buildDir, _libDir) 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_MIPS and ANDROID_NDK_ROOT envrionment variables.") + print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT envrionment variables.") end premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang" @@ -194,7 +233,7 @@ function toolchain(_buildDir, _libDir) 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_X86 and ANDROID_NDK_ROOT envrionment variables.") + print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT envrionment variables.") end premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang" @@ -516,6 +555,10 @@ function toolchain(_buildDir, _libDir) flags { "EnableAVX" } end + if _OPTIONS["with-crtnone"] then + crtNone() + end + flags { "NoPCH", "NativeWChar", @@ -1306,6 +1349,7 @@ function toolchain(_buildDir, _libDir) } links { "rt", + "dl", } linkoptions { "-Wl,--gc-sections", @@ -1400,5 +1444,11 @@ function strip() -- .. "--preload-file ../../../examples/runtime@/" } + configuration { "riscv" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(FREEDOM_E_SDK)/toolchain/bin/riscv32-unknown-elf-strip -s \"$(TARGET)\"" + } + configuration {} -- reset configuration end |