summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bx/scripts/toolchain.lua
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bx/scripts/toolchain.lua')
-rw-r--r--3rdparty/bx/scripts/toolchain.lua468
1 files changed, 173 insertions, 295 deletions
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index 03f97089b7b..964e58e3793 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2018 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bx/blob/master/LICENSE
--
local bxDir = path.getabsolute("..")
@@ -42,6 +42,21 @@ local function crtNone()
configuration {}
end
+local android = {};
+
+local function androidToolchainRoot()
+ if android.toolchainRoot == nil then
+ local hostTags = {
+ windows = "windows-x86_64",
+ linux = "linux-x86_64",
+ macosx = "darwin-x86_64"
+ }
+ android.toolchainRoot = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/" .. hostTags[os.get()]
+ end
+
+ return android.toolchainRoot;
+end
+
function toolchain(_buildDir, _libDir)
newoption {
@@ -50,16 +65,19 @@ 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" },
+ { "android-x86_64", "Android - x86_64" },
+ { "wasm2js", "Emscripten/Wasm2JS" },
+ { "wasm", "Emscripten/Wasm" },
{ "freebsd", "FreeBSD" },
{ "linux-gcc", "Linux (GCC compiler)" },
{ "linux-gcc-afl", "Linux (GCC + AFL fuzzer)" },
- { "linux-gcc-6", "Linux (GCC-6 compiler)" },
{ "linux-clang", "Linux (Clang compiler)" },
{ "linux-clang-afl", "Linux (Clang + AFL fuzzer)" },
- { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" },
{ "linux-arm-gcc", "Linux (ARM, GCC compiler)" },
+ { "linux-ppc64le-gcc", "Linux (PPC64LE, GCC compiler)" },
+ { "linux-ppc64le-clang", "Linux (PPC64LE, Clang compiler)" },
{ "ios-arm", "iOS - ARM" },
{ "ios-arm64", "iOS - ARM64" },
{ "ios-simulator", "iOS - Simulator" },
@@ -69,7 +87,8 @@ function toolchain(_buildDir, _libDir)
{ "mingw-gcc", "MinGW" },
{ "mingw-clang", "MinGW (clang compiler)" },
{ "netbsd", "NetBSD" },
- { "osx", "OSX" },
+ { "osx-x64", "OSX - x64" },
+ { "osx-arm64", "OSX - ARM64" },
{ "orbis", "Orbis" },
{ "riscv", "RISC-V" },
{ "rpi", "RaspberryPi" },
@@ -81,13 +100,7 @@ function toolchain(_buildDir, _libDir)
value = "toolset",
description = "Choose VS toolset",
allowed = {
- { "vs2012-clang", "Clang 3.6" },
- { "vs2013-clang", "Clang 3.6" },
- { "vs2015-clang", "Clang 3.9" },
{ "vs2017-clang", "Clang with MS CodeGen" },
- { "vs2012-xp", "Visual Studio 2012 targeting XP" },
- { "vs2013-xp", "Visual Studio 2013 targeting XP" },
- { "vs2015-xp", "Visual Studio 2015 targeting XP" },
{ "vs2017-xp", "Visual Studio 2017 targeting XP" },
{ "winstore100", "Universal Windows App 10.0" },
{ "durango", "Durango" },
@@ -109,7 +122,7 @@ function toolchain(_buildDir, _libDir)
newoption {
trigger = "with-android",
value = "#",
- description = "Set Android platform version (default: android-14).",
+ description = "Set Android platform version (default: android-24).",
}
newoption {
@@ -162,9 +175,9 @@ function toolchain(_buildDir, _libDir)
os.exit(1)
end
- local androidPlatform = "android-24"
+ local androidApiLevel = 24
if _OPTIONS["with-android"] then
- androidPlatform = "android-" .. _OPTIONS["with-android"]
+ androidApiLevel = _OPTIONS["with-android"]
end
local iosPlatform = ""
@@ -182,9 +195,11 @@ function toolchain(_buildDir, _libDir)
tvosPlatform = _OPTIONS["with-tvos"]
end
- local windowsPlatform = string.gsub(os.getenv("WindowsSDKVersion") or "8.1", "\\", "")
+ local windowsPlatform = nil
if _OPTIONS["with-windows"] then
windowsPlatform = _OPTIONS["with-windows"]
+ elseif nil ~= os.getenv("WindowsSDKVersion") then
+ windowsPlatform = string.gsub(os.getenv("WindowsSDKVersion"), "\\", "")
end
local compiler32bit = false
@@ -193,7 +208,9 @@ function toolchain(_buildDir, _libDir)
end
flags {
+ "Cpp14",
"ExtraWarnings",
+ "FloatFast",
}
if _ACTION == "gmake" or _ACTION == "ninja" then
@@ -203,45 +220,30 @@ function toolchain(_buildDir, _libDir)
os.exit(1)
end
- 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, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT environment variables.")
- end
+ if "android-arm" == _OPTIONS["gcc"]
+ or "android-arm64" == _OPTIONS["gcc"]
+ or "android-x86" == _OPTIONS["gcc"]
+ or "android-x86_64" == _OPTIONS["gcc"] then
- 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.cc = androidToolchainRoot() .. "/bin/clang"
+ premake.gcc.cxx = androidToolchainRoot() .. "/bin/clang++"
+ premake.gcc.ar = androidToolchainRoot() .. "/bin/llvm-ar"
premake.gcc.llvm = true
- location (path.join(_buildDir, "projects", _ACTION .. "-android-arm"))
-
- 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_X86, 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-x86"))
+ location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"]))
- elseif "asmjs" == _OPTIONS["gcc"] then
+ elseif "wasm2js" == _OPTIONS["gcc"] or "wasm" == _OPTIONS["gcc"] then
if not os.getenv("EMSCRIPTEN") then
- print("Set EMSCRIPTEN environment variable.")
+ print("Set EMSCRIPTEN environment variable to root directory of your Emscripten installation. (e.g. by entering the EMSDK command prompt)")
end
premake.gcc.cc = "\"$(EMSCRIPTEN)/emcc\""
premake.gcc.cxx = "\"$(EMSCRIPTEN)/em++\""
premake.gcc.ar = "\"$(EMSCRIPTEN)/emar\""
premake.gcc.llvm = true
- location (path.join(_buildDir, "projects", _ACTION .. "-asmjs"))
+ premake.gcc.namestyle = "Emscripten"
+ location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"]))
elseif "freebsd" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-freebsd"))
@@ -286,12 +288,6 @@ function toolchain(_buildDir, _libDir)
premake.gcc.ar = "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
- elseif "linux-gcc-6" == _OPTIONS["gcc"] then
- premake.gcc.cc = "gcc-6"
- premake.gcc.cxx = "g++-6"
- premake.gcc.ar = "ar"
- location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
-
elseif "linux-clang" == _OPTIONS["gcc"] then
premake.gcc.cc = "clang"
premake.gcc.cxx = "clang++"
@@ -304,21 +300,18 @@ function toolchain(_buildDir, _libDir)
premake.gcc.ar = "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
- elseif "linux-mips-gcc" == _OPTIONS["gcc"] then
- location (path.join(_buildDir, "projects", _ACTION .. "-linux-mips-gcc"))
-
elseif "linux-arm-gcc" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc"))
- elseif "linux-steamlink" == _OPTIONS["gcc"] then
- if not os.getenv("MARVELL_SDK_PATH") then
- print("Set MARVELL_SDK_PATH environment variable.")
- end
+ elseif "linux-ppc64le-gcc" == _OPTIONS["gcc"] then
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-ppc64le-gcc"))
- premake.gcc.cc = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-gcc"
- premake.gcc.cxx = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-g++"
- premake.gcc.ar = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-ar"
- location (path.join(_buildDir, "projects", _ACTION .. "-linux-steamlink"))
+ elseif "linux-ppc64le-clang" == _OPTIONS["gcc"] then
+ premake.gcc.cc = "clang"
+ premake.gcc.cxx = "clang++"
+ premake.gcc.ar = "ar"
+ premake.gcc.llvm = true
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-ppc64le-clang"))
elseif "mingw-gcc" == _OPTIONS["gcc"] then
if not os.getenv("MINGW") then
@@ -350,7 +343,9 @@ function toolchain(_buildDir, _libDir)
elseif "netbsd" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-netbsd"))
- elseif "osx" == _OPTIONS["gcc"] then
+ elseif "osx-x64" == _OPTIONS["gcc"]
+ or "osx-arm64" == _OPTIONS["gcc"] then
+
if os.is("linux") then
if not os.getenv("OSXCROSS") then
@@ -362,7 +357,8 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cxx = "$(OSXCROSS)/target/bin/" .. osxToolchain .. "clang++"
premake.gcc.ar = "$(OSXCROSS)/target/bin/" .. osxToolchain .. "ar"
end
- location (path.join(_buildDir, "projects", _ACTION .. "-osx"))
+
+ location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"]))
elseif "orbis" == _OPTIONS["gcc"] then
@@ -387,21 +383,20 @@ function toolchain(_buildDir, _libDir)
location (path.join(_buildDir, "projects", _ACTION .. "-riscv"))
end
- elseif _ACTION == "vs2012"
- or _ACTION == "vs2013"
- or _ACTION == "vs2015"
- or _ACTION == "vs2017"
+ elseif _ACTION == "vs2017"
+ or _ACTION == "vs2019"
+ or _ACTION == "vs2022"
then
local action = premake.action.current()
- action.vstudio.windowsTargetPlatformVersion = windowsPlatform
- action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform
+ if nil ~= windowsPlatform then
+ action.vstudio.windowsTargetPlatformVersion = windowsPlatform
+ action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform
+ end
if (_ACTION .. "-clang") == _OPTIONS["vs"] then
if "vs2017-clang" == _OPTIONS["vs"] then
premake.vstudio.toolset = "v141_clang_c2"
- elseif "vs2015-clang" == _OPTIONS["vs"] then
- premake.vstudio.toolset = "LLVM-vs2014"
else
premake.vstudio.toolset = ("LLVM-" .. _ACTION)
end
@@ -432,27 +427,9 @@ function toolchain(_buildDir, _libDir)
platforms { "Orbis" }
location (path.join(_buildDir, "projects", _ACTION .. "-orbis"))
- elseif ("vs2012-xp") == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v110_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
- elseif "vs2013-xp" == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v120_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
- elseif "vs2015-xp" == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v140_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
- elseif "vs2015-xp" == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v141_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
end
- elseif _ACTION == "xcode4"
- or _ACTION == "xcode8"
- or _ACTION == "xcode9" then
+ elseif _ACTION and _ACTION:match("^xcode.+$") then
local action = premake.action.current()
local str_or = function(str, def)
return #str > 0 and str or def
@@ -519,9 +496,9 @@ function toolchain(_buildDir, _libDir)
}
targetsuffix "Release"
- configuration { "qbs" }
- flags {
- "ExtraWarnings",
+ configuration { "*-clang" }
+ buildoptions {
+ "-Wno-tautological-constant-compare",
}
configuration { "vs*", "x32" }
@@ -535,8 +512,6 @@ function toolchain(_buildDir, _libDir)
"WIN32",
"_WIN32",
"_HAS_EXCEPTIONS=0",
- "_HAS_ITERATOR_DEBUGGING=0",
- "_ITERATOR_DEBUG_LEVEL=0",
"_SCL_SECURE=0",
"_SECURE_SCL=0",
"_SCL_SECURE_NO_WARNINGS",
@@ -547,14 +522,12 @@ function toolchain(_buildDir, _libDir)
"/wd4201", -- warning C4201: nonstandard extension used: nameless struct/union
"/wd4324", -- warning C4324: '': structure was padded due to alignment specifier
"/Ob2", -- The Inline Function Expansion
+ "/Zc:__cplusplus", -- Enable updated __cplusplus macro
}
linkoptions {
"/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
}
- configuration { "vs2008" }
- includedirs { path.join(bxDir, "include/compat/msvc/pre1600") }
-
configuration { "x32", "vs*" }
targetdir (path.join(_buildDir, "win32_" .. _ACTION, "bin"))
objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
@@ -633,9 +606,6 @@ function toolchain(_buildDir, _libDir)
"-Wunused-value",
"-Wundef",
}
- buildoptions_cpp {
- "-std=c++14",
- }
linkoptions {
"-Wl,--gc-sections",
"-static",
@@ -664,9 +634,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",
@@ -689,20 +659,8 @@ function toolchain(_buildDir, _libDir)
}
buildoptions { "-m64" }
- configuration { "linux-clang" }
-
- configuration { "linux-gcc-6" }
- buildoptions {
--- "-fno-omit-frame-pointer",
--- "-fsanitize=address",
--- "-fsanitize=undefined",
--- "-fsanitize=float-divide-by-zero",
--- "-fsanitize=float-cast-overflow",
- }
- links {
--- "asan",
--- "ubsan",
- }
+ configuration { "linux-*" }
+ includedirs { path.join(bxDir, "include/compat/linux") }
configuration { "linux-gcc" }
buildoptions {
@@ -722,9 +680,6 @@ function toolchain(_buildDir, _libDir)
"-Wundef",
-- "-Wuseless-cast",
}
- buildoptions_cpp {
- "-std=c++14",
- }
links {
"rt",
"dl",
@@ -771,25 +726,6 @@ function toolchain(_buildDir, _libDir)
"-m64",
}
- configuration { "linux-mips-gcc" }
- targetdir (path.join(_buildDir, "linux32_mips_gcc/bin"))
- objdir (path.join(_buildDir, "linux32_mips_gcc/obj"))
- libdirs { path.join(_libDir, "lib/linux32_mips_gcc") }
- buildoptions {
- "-Wunused-value",
- "-Wundef",
- }
- buildoptions_cpp {
- "-std=c++14",
- }
- links {
- "rt",
- "dl",
- }
- linkoptions {
- "-Wl,--gc-sections",
- }
-
configuration { "linux-arm-gcc" }
targetdir (path.join(_buildDir, "linux32_arm_gcc/bin"))
objdir (path.join(_buildDir, "linux32_arm_gcc/obj"))
@@ -798,9 +734,6 @@ function toolchain(_buildDir, _libDir)
"-Wunused-value",
"-Wundef",
}
- buildoptions_cpp {
- "-std=c++14",
- }
links {
"rt",
"dl",
@@ -814,14 +747,6 @@ function toolchain(_buildDir, _libDir)
flags {
"NoImportLib",
}
- includedirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/include",
- "${ANDROID_NDK_ROOT}/sysroot/usr/include",
- "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
- }
- linkoptions {
- "-nostdlib",
- }
links {
"c",
"dl",
@@ -829,9 +754,11 @@ function toolchain(_buildDir, _libDir)
"android",
"log",
"c++_shared",
- "gcc",
}
buildoptions {
+ "--gcc-toolchain=" .. androidToolchainRoot(),
+ "--sysroot=" .. androidToolchainRoot() .. "/sysroot",
+ "-DANDROID",
"-fPIC",
"-no-canonical-prefixes",
"-Wa,--noexecstack",
@@ -840,10 +767,9 @@ function toolchain(_buildDir, _libDir)
"-Wunused-value",
"-Wundef",
}
- buildoptions_cpp {
- "-std=c++14",
- }
linkoptions {
+ "--gcc-toolchain=" .. androidToolchainRoot(),
+ "--sysroot=" .. androidToolchainRoot() .. "/sysroot",
"-no-canonical-prefixes",
"-Wl,--no-undefined",
"-Wl,-z,noexecstack",
@@ -851,103 +777,102 @@ function toolchain(_buildDir, _libDir)
"-Wl,-z,now",
}
- configuration { "linux-steamlink" }
- targetdir (path.join(_buildDir, "steamlink/bin"))
- objdir (path.join(_buildDir, "steamlink/obj"))
- libdirs { path.join(_libDir, "lib/steamlink") }
- includedirs { path.join(bxDir, "include/compat/linux") }
- defines {
- "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it.
- }
- buildoptions {
- "-std=c++14",
- "-Wfatal-errors",
- "-Wunused-value",
- "-Wundef",
- "-pthread",
- "-marm",
- "-mfloat-abi=hard",
- "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
- }
- linkoptions {
- "-static-libgcc",
- "-static-libstdc++",
- "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
- }
-
configuration { "android-arm" }
targetdir (path.join(_buildDir, "android-arm/bin"))
objdir (path.join(_buildDir, "android-arm/obj"))
- libdirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a",
- }
- includedirs {
- "$(ANDROID_NDK_ROOT)/sysroot/usr/include/arm-linux-androideabi",
- }
buildoptions {
- "-gcc-toolchain $(ANDROID_NDK_ARM)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
- "-target armv7-none-linux-androideabi",
+ "--target=armv7-none-linux-android" .. androidApiLevel,
"-mthumb",
"-march=armv7-a",
"-mfloat-abi=softfp",
"-mfpu=neon",
- "-Wunused-value",
- "-Wundef",
}
linkoptions {
- "-gcc-toolchain $(ANDROID_NDK_ARM)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtbegin_so.o"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtend_so.o"),
- "-target armv7-none-linux-androideabi",
+ "--target=armv7-none-linux-android" .. androidApiLevel,
"-march=armv7-a",
- "-Wl,--fix-cortex-a8",
+ }
+
+ configuration { "android-arm64" }
+ targetdir (path.join(_buildDir, "android-arm64/bin"))
+ objdir (path.join(_buildDir, "android-arm64/obj"))
+ buildoptions {
+ "--target=aarch64-none-linux-android" .. androidApiLevel,
+ }
+ linkoptions {
+ "--target=aarch64-none-linux-android" .. androidApiLevel,
}
configuration { "android-x86" }
targetdir (path.join(_buildDir, "android-x86/bin"))
objdir (path.join(_buildDir, "android-x86/obj"))
- libdirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/x86",
- }
- includedirs {
- "$(ANDROID_NDK_ROOT)/sysroot/usr/include/x86_64-linux-android",
- }
buildoptions {
- "-gcc-toolchain $(ANDROID_NDK_X86)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
- "-target i686-none-linux-android",
- "-march=i686",
+ "--target=i686-none-linux-android" .. androidApiLevel,
"-mtune=atom",
"-mstackrealign",
"-msse3",
"-mfpmath=sse",
+ }
+ linkoptions {
+ "--target=i686-none-linux-android" .. androidApiLevel,
+ }
+
+ configuration { "android-x86_64" }
+ targetdir (path.join(_buildDir, "android-x86_64/bin"))
+ objdir (path.join(_buildDir, "android-x86_64/obj"))
+ buildoptions {
+ "--target=x86_64-none-linux-android" .. androidApiLevel,
+ }
+ linkoptions {
+ "--target=x86_64-none-linux-android" .. androidApiLevel,
+ }
+
+ configuration { "wasm*" }
+ buildoptions {
"-Wunused-value",
"-Wundef",
}
+
linkoptions {
- "-gcc-toolchain $(ANDROID_NDK_X86)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtbegin_so.o"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtend_so.o"),
- "-target i686-none-linux-android",
+ "-s MAX_WEBGL_VERSION=2",
}
- configuration { "asmjs" }
- targetdir (path.join(_buildDir, "asmjs/bin"))
- objdir (path.join(_buildDir, "asmjs/obj"))
- libdirs { path.join(_libDir, "lib/asmjs") }
+ configuration { "linux-ppc64le*" }
buildoptions {
- "-i\"system$(EMSCRIPTEN)/system/include\"",
- "-i\"system$(EMSCRIPTEN)/system/include/libcxx\"",
- "-i\"system$(EMSCRIPTEN)/system/include/libc\"",
+ "-fsigned-char",
"-Wunused-value",
"-Wundef",
+ "-mcpu=power8",
}
- buildoptions_cpp {
- "-std=c++14",
+ links {
+ "rt",
+ "dl",
}
+ linkoptions {
+ "-Wl,--gc-sections",
+ }
+
+ configuration { "linux-ppc64le-gcc" }
+ targetdir (path.join(_buildDir, "linux_ppc64le_gcc/bin"))
+ objdir (path.join(_buildDir, "linux_ppc64le_gcc/obj"))
+ libdirs { path.join(_libDir, "lib/linux_ppc64le_gcc") }
+
+ configuration { "linux-ppc64le-clang" }
+ targetdir (path.join(_buildDir, "linux_ppc64le_clang/bin"))
+ objdir (path.join(_buildDir, "linux_ppc64le_clang/obj"))
+ libdirs { path.join(_libDir, "lib/linux_ppc64le_clang") }
+
+ configuration { "wasm2js" }
+ targetdir (path.join(_buildDir, "wasm2js/bin"))
+ objdir (path.join(_buildDir, "wasm2js/obj"))
+ libdirs { path.join(_libDir, "lib/wasm2js") }
+ linkoptions {
+ "-s WASM=0",
+ }
+
+ configuration { "wasm" }
+ targetdir (path.join(_buildDir, "wasm/bin"))
+ objdir (path.join(_buildDir, "wasm/obj"))
+ libdirs { path.join(_libDir, "lib/wasm") }
configuration { "freebsd" }
targetdir (path.join(_buildDir, "freebsd/bin"))
@@ -984,36 +909,33 @@ function toolchain(_buildDir, _libDir)
path.join(bxDir, "include/compat/freebsd"),
}
- configuration { "osx", "x32" }
- targetdir (path.join(_buildDir, "osx32_clang/bin"))
- objdir (path.join(_buildDir, "osx32_clang/obj"))
- --libdirs { path.join(_libDir, "lib/osx32_clang") }
- buildoptions {
- "-m32",
+ configuration { "osx-x64" }
+ targetdir (path.join(_buildDir, "osx-x64/bin"))
+ objdir (path.join(_buildDir, "osx-x64/obj"))
+ linkoptions {
+ "-arch x86_64",
}
-
- configuration { "osx", "x64" }
- targetdir (path.join(_buildDir, "osx64_clang/bin"))
- objdir (path.join(_buildDir, "osx64_clang/obj"))
- --libdirs { path.join(_libDir, "lib/osx64_clang") }
buildoptions {
- "-m64",
+ "-arch x86_64",
+ "-msse2",
+ "-target x86_64-apple-macos" .. (#macosPlatform > 0 and macosPlatform or "10.11"),
}
- configuration { "osx", "Universal" }
- targetdir (path.join(_buildDir, "osx_universal/bin"))
- objdir (path.join(_buildDir, "osx_universal/bin"))
-
- configuration { "osx" }
- buildoptions_cpp {
- "-std=c++14",
+ configuration { "osx-arm64" }
+ targetdir (path.join(_buildDir, "osx-arm64/bin"))
+ objdir (path.join(_buildDir, "osx-arm64/obj"))
+ linkoptions {
+ "-arch arm64",
}
- buildoptions_objcpp {
- "-std=c++14",
+ buildoptions {
+ "-arch arm64",
+ "-Wno-error=unused-command-line-argument",
+ "-Wno-unused-command-line-argument",
}
+
+ configuration { "osx*" }
buildoptions {
"-Wfatal-errors",
- "-msse2",
"-Wunused-value",
"-Wundef",
}
@@ -1023,12 +945,6 @@ function toolchain(_buildDir, _libDir)
linkoptions {
"-lc++",
}
- buildoptions_cpp {
- "-std=c++14",
- }
- buildoptions_objcpp {
- "-std=c++14",
- }
buildoptions {
"-Wfatal-errors",
"-Wunused-value",
@@ -1064,15 +980,16 @@ function toolchain(_buildDir, _libDir)
configuration { "ios-arm*" }
linkoptions {
- "-miphoneos-version-min=7.0",
+ "-miphoneos-version-min=9.0",
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk",
"-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/usr/lib/system",
"-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/Frameworks",
"-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks",
}
buildoptions {
- "-miphoneos-version-min=7.0",
+ "-miphoneos-version-min=9.0",
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk",
+ "-fembed-bitcode",
}
configuration { "ios-simulator" }
@@ -1080,7 +997,7 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "ios-simulator/obj"))
libdirs { path.join(_libDir, "lib/ios-simulator") }
linkoptions {
- "-mios-simulator-version-min=7.0",
+ "-mios-simulator-version-min=9.0",
"-arch i386",
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
"-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/usr/lib/system",
@@ -1088,7 +1005,7 @@ function toolchain(_buildDir, _libDir)
"-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks",
}
buildoptions {
- "-mios-simulator-version-min=7.0",
+ "-mios-simulator-version-min=9.0",
"-arch i386",
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
}
@@ -1098,7 +1015,7 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "ios-simulator64/obj"))
libdirs { path.join(_libDir, "lib/ios-simulator64") }
linkoptions {
- "-mios-simulator-version-min=7.0",
+ "-mios-simulator-version-min=9.0",
"-arch x86_64",
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
"-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/usr/lib/system",
@@ -1106,7 +1023,7 @@ function toolchain(_buildDir, _libDir)
"-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks",
}
buildoptions {
- "-mios-simulator-version-min=7.0",
+ "-mios-simulator-version-min=9.0",
"-arch x86_64",
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
}
@@ -1171,9 +1088,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 +1104,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 +1133,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
@@ -1233,25 +1141,13 @@ end
function strip()
- configuration { "android-arm", "Release" }
- postbuildcommands {
- "$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
- }
-
- configuration { "android-x86", "Release" }
+ configuration { "android-*", "Release" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\""
+ "$(SILENT) " .. androidToolchainRoot() .. "/bin/llvm-strip -s \"$(TARGET)\""
}
- configuration { "linux-steamlink", "Release" }
- postbuildcommands {
- "$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-strip -s \"$(TARGET)\""
- }
-
- configuration { "linux-* or rpi", "not linux-steamlink", "Release" }
+ configuration { "linux-* or rpi", "Release" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",
"$(SILENT) strip -s \"$(TARGET)\""
@@ -1263,24 +1159,6 @@ function strip()
"$(SILENT) $(MINGW)/bin/strip -s \"$(TARGET)\""
}
- configuration { "asmjs" }
- postbuildcommands {
- "$(SILENT) echo Running asmjs finalize.",
- "$(SILENT) \"$(EMSCRIPTEN)/emcc\" -O2 "
-
--- .. "-s ALLOW_MEMORY_GROWTH=1 "
--- .. "-s ASSERTIONS=2 "
--- .. "-s EMTERPRETIFY=1 "
--- .. "-s EMTERPRETIFY_ASYNC=1 "
- .. "-s PRECISE_F32=1 "
- .. "-s TOTAL_MEMORY=268435456 "
--- .. "-s USE_WEBGL2=1 "
-
- .. "--memory-init-file 1 "
- .. "\"$(TARGET)\" -o \"$(TARGET)\".html "
--- .. "--preload-file ../../../examples/runtime@/ "
- }
-
configuration { "riscv" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",