summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/toolchain.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/toolchain.lua')
-rw-r--r--scripts/toolchain.lua123
1 files changed, 92 insertions, 31 deletions
diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua
index 91d1f29884e..08712050751 100644
--- a/scripts/toolchain.lua
+++ b/scripts/toolchain.lua
@@ -24,6 +24,8 @@ newoption {
{ "mingw-clang", "MinGW (clang compiler)" },
{ "nacl", "Native Client" },
{ "nacl-arm", "Native Client - ARM" },
+ { "netbsd", "NetBSD" },
+ { "os2", "OS/2" },
{ "osx", "OSX (GCC compiler)" },
{ "osx-clang", "OSX (Clang compiler)" },
{ "pnacl", "Native Client - PNaCl" },
@@ -147,6 +149,10 @@ function toolchain(_buildDir, _subDir)
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-freebsd")
end
+ if "netbsd" == _OPTIONS["gcc"] then
+ location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-netbsd")
+ end
+
if "ios-arm" == _OPTIONS["gcc"] then
premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
@@ -166,7 +172,7 @@ function toolchain(_buildDir, _subDir)
if _OPTIONS["distro"]=="ubuntu-intrepid" then
premake.gcc.cc = "@gcc -V 4.2"
premake.gcc.cxx = "@g++-4.2"
- end
+ end
premake.gcc.ar = "ar"
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-linux")
end
@@ -186,20 +192,34 @@ function toolchain(_buildDir, _subDir)
if "mingw32-gcc" == _OPTIONS["gcc"] then
if not os.getenv("MINGW32") or not os.getenv("MINGW32") then
print("Set MINGW32 envrionment variable.")
- end
+ end
premake.gcc.cc = "$(MINGW32)/bin/i686-w64-mingw32-gcc"
premake.gcc.cxx = "$(MINGW32)/bin/i686-w64-mingw32-g++"
- premake.gcc.ar = "$(MINGW32)/bin/ar"
+-- work around GCC 4.9.2 not having proper linker for LTO=1 usage
+ local version_4_ar = str_to_version(_OPTIONS["gcc_version"])
+ if (version_4_ar < 50000) then
+ premake.gcc.ar = "$(MINGW32)/bin/ar"
+ end
+ if (version_4_ar >= 50000) then
+ premake.gcc.ar = "$(MINGW32)/bin/gcc-ar"
+ end
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw32-gcc")
end
if "mingw64-gcc" == _OPTIONS["gcc"] then
if not os.getenv("MINGW64") or not os.getenv("MINGW64") then
print("Set MINGW64 envrionment variable.")
- end
+ end
premake.gcc.cc = "$(MINGW64)/bin/x86_64-w64-mingw32-gcc"
premake.gcc.cxx = "$(MINGW64)/bin/x86_64-w64-mingw32-g++"
- premake.gcc.ar = "$(MINGW64)/bin/ar"
+-- work around GCC 4.9.2 not having proper linker for LTO=1 usage
+ local version_4_ar = str_to_version(_OPTIONS["gcc_version"])
+ if (version_4_ar < 50000) then
+ premake.gcc.ar = "$(MINGW64)/bin/ar"
+ end
+ if (version_4_ar >= 50000) then
+ premake.gcc.ar = "$(MINGW64)/bin/gcc-ar"
+ end
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw64-gcc")
end
@@ -301,6 +321,10 @@ function toolchain(_buildDir, _subDir)
if "rpi" == _OPTIONS["gcc"] then
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi")
end
+
+ if "os2" == _OPTIONS["gcc"] then
+ location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-os2")
+ end
elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then
if (_ACTION .. "-clang") == _OPTIONS["vs"] then
@@ -325,14 +349,14 @@ function toolchain(_buildDir, _subDir)
platforms { "ARM" }
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winstore81")
end
-
+
if "winstore82" == _OPTIONS["vs"] then
premake.vstudio.toolset = "v140"
premake.vstudio.storeapp = "8.2"
platforms { "ARM" }
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winstore82")
end
-
+
if "intel-14" == _OPTIONS["vs"] then
premake.vstudio.toolset = "Intel C++ Compiler XE 14.0"
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel")
@@ -347,11 +371,11 @@ function toolchain(_buildDir, _subDir)
premake.vstudio.toolset = ("v110_xp")
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-xp")
end
-
+
if ("vs2013-xp") == _OPTIONS["vs"] then
premake.vstudio.toolset = ("v120_xp")
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-xp")
- end
+ end
elseif _ACTION == "xcode4" then
if "osx" == _OPTIONS["xcode"] then
@@ -369,11 +393,11 @@ function toolchain(_buildDir, _subDir)
end
if (_OPTIONS["CXX"] ~= nil) then
premake.gcc.cxx = _OPTIONS["CXX"]
- end
+ end
if (_OPTIONS["LD"] ~= nil) then
premake.gcc.ld = _OPTIONS["LD"]
- end
-
+ end
+
configuration {} -- reset configuration
@@ -423,12 +447,12 @@ function toolchain(_buildDir, _subDir)
configuration { "x64", "vs*-clang", "Debug" }
targetdir (_buildDir .. _ACTION .. "-clang/bin/x64/Debug")
-
+
configuration { "vs*-clang" }
buildoptions {
"-Qunused-arguments",
- }
-
+ }
+
configuration { "winphone8* or winstore8*" }
removeflags {
"StaticRuntime",
@@ -452,7 +476,7 @@ function toolchain(_buildDir, _subDir)
configuration { "x64", "mingw64-gcc" }
objdir (_buildDir .. "mingw-gcc" .. "/obj")
buildoptions { "-m64" }
-
+
configuration { "x64", "mingw64-gcc", "Release" }
targetdir (_buildDir .. "mingw-gcc" .. "/bin/x64/Release")
@@ -480,7 +504,7 @@ function toolchain(_buildDir, _subDir)
configuration { "x32", "mingw-clang", "Debug" }
targetdir (_buildDir .. "win32_mingw-clang/bin/x32/Debug")
-
+
configuration { "x64", "mingw-clang" }
objdir (_buildDir .. "mingw-clang/obj")
buildoptions { "-m64" }
@@ -488,14 +512,14 @@ function toolchain(_buildDir, _subDir)
"-isystem$(MINGW64)/x86_64-w64-mingw32/include/c++",
"-isystem$(MINGW64)/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32",
"-isystem$(MINGW64)/x86_64-w64-mingw32/include",
- }
+ }
configuration { "x64", "mingw-clang", "Release" }
targetdir (_buildDir .. "mingw-clang/bin/x64/Release")
configuration { "x64", "mingw-clang", "Debug" }
targetdir (_buildDir .. "mingw-clang/bin/x64/Debug")
-
+
configuration { "linux-gcc", "x32" }
objdir (_buildDir .. "linux_gcc" .. "/obj")
buildoptions {
@@ -516,7 +540,7 @@ function toolchain(_buildDir, _subDir)
configuration { "linux-gcc", "x64", "Release" }
targetdir (_buildDir .. "linux_gcc" .. "/bin/x64/Release")
-
+
configuration { "linux-gcc", "x64", "Debug" }
targetdir (_buildDir .. "linux_gcc" .. "/bin/x64/Debug")
@@ -543,7 +567,7 @@ function toolchain(_buildDir, _subDir)
configuration { "linux-clang", "x64", "Debug" }
targetdir (_buildDir .. "linux_clang" .. "/bin/x64/Debug")
-
+
configuration { "solaris", "x32" }
objdir (_buildDir .. "solaris" .. "/obj")
buildoptions {
@@ -552,7 +576,7 @@ function toolchain(_buildDir, _subDir)
configuration { "solaris", "x32", "Release" }
targetdir (_buildDir .. "solaris" .. "/bin/x32/Release")
-
+
configuration { "solaris", "x32", "Debug" }
targetdir (_buildDir .. "solaris" .. "/bin/x32/Debug")
@@ -564,7 +588,7 @@ function toolchain(_buildDir, _subDir)
configuration { "solaris", "x64", "Release" }
targetdir (_buildDir .. "solaris" .. "/bin/x64/Release")
-
+
configuration { "solaris", "x64", "Debug" }
targetdir (_buildDir .. "solaris" .. "/bin/x64/Debug")
@@ -576,7 +600,7 @@ function toolchain(_buildDir, _subDir)
configuration { "freebsd", "x32", "Release" }
targetdir (_buildDir .. "freebsd" .. "/bin/x32/Release")
-
+
configuration { "freebsd", "x32", "Debug" }
targetdir (_buildDir .. "freebsd" .. "/bin/x32/Debug")
@@ -587,10 +611,32 @@ function toolchain(_buildDir, _subDir)
}
configuration { "freebsd", "x64", "Release" }
targetdir (_buildDir .. "freebsd" .. "/bin/x64/Release")
-
+
configuration { "freebsd", "x64", "Debug" }
targetdir (_buildDir .. "freebsd" .. "/bin/x64/Debug")
-
+
+ configuration { "netbsd", "x32" }
+ objdir (_buildDir .. "netbsd" .. "/obj")
+ buildoptions {
+ "-m32",
+ }
+ configuration { "netbsd", "x32", "Release" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x32/Release")
+
+ configuration { "netbsd", "x32", "Debug" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x32/Debug")
+
+ configuration { "netbsd", "x64" }
+ objdir (_buildDir .. "netbsd" .. "/obj")
+ buildoptions {
+ "-m64",
+ }
+ configuration { "netbsd", "x64", "Release" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x64/Release")
+
+ configuration { "netbsd", "x64", "Debug" }
+ targetdir (_buildDir .. "netbsd" .. "/bin/x64/Debug")
+
configuration { "android-*" }
includedirs {
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
@@ -729,7 +775,7 @@ function toolchain(_buildDir, _subDir)
"-fdiagnostics-show-option",
"-fdata-sections",
"-ffunction-sections",
- "-Wunused-value",
+ "-Wunused-value",
}
configuration { "nacl or nacl-arm" }
includedirs {
@@ -737,10 +783,10 @@ function toolchain(_buildDir, _subDir)
"$(NACL_SDK_ROOT)/include/newlib",
}
- configuration { "pnacl" }
+ configuration { "pnacl" }
buildoptions {
"-Wno-tautological-undefined-compare",
- "-Wno-cast-align",
+ "-Wno-cast-align",
}
includedirs {
"$(NACL_SDK_ROOT)/include",
@@ -797,7 +843,7 @@ function toolchain(_buildDir, _subDir)
configuration { "osx*", "x32", "Debug" }
targetdir (_buildDir .. "osx_clang" .. "/bin/x32/Debug")
-
+
configuration { "osx*", "x64" }
objdir (_buildDir .. "osx_clang" .. "/obj")
buildoptions {
@@ -809,7 +855,7 @@ function toolchain(_buildDir, _subDir)
configuration { "osx*", "x64", "Debug" }
targetdir (_buildDir .. "osx_clang" .. "/bin/x64/Debug")
-
+
configuration { "ios-arm" }
targetdir (_buildDir .. "ios-arm" .. "/bin")
objdir (_buildDir .. "ios-arm" .. "/obj")
@@ -826,6 +872,15 @@ function toolchain(_buildDir, _subDir)
targetdir (_buildDir .. "rpi" .. "/bin")
objdir (_buildDir .. "rpi" .. "/obj")
+ configuration { "os2" }
+ objdir (_buildDir .. "os2" .. "/obj")
+
+ configuration { "os2", "Release" }
+ targetdir (_buildDir .. "os2" .. "/bin/Release")
+
+ configuration { "os2", "Debug" }
+ targetdir (_buildDir .. "os2" .. "/bin/Debug")
+
configuration {} -- reset configuration
return true
@@ -888,6 +943,12 @@ function strip()
-- ALLOW_MEMORY_GROWTH
}
+ configuration { "os2", "Release" }
+ postbuildcommands {
+ "$(SILENT) echo Stripping symbols.",
+ "$(SILENT) lxlite /B- /L- /CS \"$(TARGET)\""
+ }
+
configuration {} -- reset configuration
end