diff options
Diffstat (limited to 'scripts/toolchain.lua')
-rw-r--r-- | scripts/toolchain.lua | 59 |
1 files changed, 20 insertions, 39 deletions
diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 137a873ae09..7fad61ce928 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -4,11 +4,6 @@ -- local naclToolchain = "" -local toolchainPrefix = "" - -if _OPTIONS['TOOLCHAIN'] then - toolchainPrefix = _OPTIONS["TOOLCHAIN"] -end newoption { trigger = "gcc", @@ -209,18 +204,15 @@ function toolchain(_buildDir, _subDir) if not os.getenv("MINGW32") then print("Set MINGW32 envrionment variable.") end - if not toolchainPrefix then - toolchainPrefix = "$(MINGW32)/bin/i686-w64-mingw32-" - end - premake.gcc.cc = toolchainPrefix .. "gcc" - premake.gcc.cxx = toolchainPrefix .. "g++" + premake.gcc.cc = "$(MINGW32)/bin/i686-w64-mingw32-gcc" + premake.gcc.cxx = "$(MINGW32)/bin/i686-w64-mingw32-g++" -- 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 = toolchainPrefix .. "ar" + premake.gcc.ar = "$(MINGW32)/bin/ar" end if (version_4_ar >= 50000) then - premake.gcc.ar = toolchainPrefix .. "gcc-ar" + premake.gcc.ar = "$(MINGW32)/bin/gcc-ar" end location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw32-gcc") end @@ -229,22 +221,20 @@ function toolchain(_buildDir, _subDir) if not os.getenv("MINGW64") then print("Set MINGW64 envrionment variable.") end - if not toolchainPrefix then - toolchainPrefix = "$(MINGW64)/bin/x86_64-w64-mingw32-" - end - premake.gcc.cc = toolchainPrefix .. "gcc" - premake.gcc.cxx = toolchainPrefix .. "g++" + premake.gcc.cc = "$(MINGW64)/bin/x86_64-w64-mingw32-gcc" + premake.gcc.cxx = "$(MINGW64)/bin/x86_64-w64-mingw32-g++" -- 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 = toolchainPrefix .. "ar" + premake.gcc.ar = "$(MINGW64)/bin/ar" end if (version_4_ar >= 50000) then - premake.gcc.ar = toolchainPrefix .. "gcc-ar" + premake.gcc.ar = "$(MINGW64)/bin/gcc-ar" end location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw64-gcc") end + if "mingw-clang" == _OPTIONS["gcc"] then premake.gcc.cc = "clang" premake.gcc.cxx = "clang++" @@ -293,17 +283,18 @@ function toolchain(_buildDir, _subDir) if "osx" == _OPTIONS["gcc"] then if os.is("linux") then - premake.gcc.cc = toolchainPrefix .. "clang" - premake.gcc.cxx = toolchainPrefix .. "clang++" - premake.gcc.ar = toolchainPrefix .. "ar" + local osxToolchain = "x86_64-apple-darwin13-" + premake.gcc.cc = osxToolchain .. "clang" + premake.gcc.cxx = osxToolchain .. "clang++" + premake.gcc.ar = osxToolchain .. "ar" end location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx") end if "osx-clang" == _OPTIONS["gcc"] then - premake.gcc.cc = toolchainPrefix .. "clang" - premake.gcc.cxx = toolchainPrefix .. "clang++" - premake.gcc.ar = toolchainPrefix .. "ar" + premake.gcc.cc = "clang" + premake.gcc.cxx = "clang++" + premake.gcc.ar = "ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") end @@ -505,9 +496,7 @@ function toolchain(_buildDir, _subDir) configuration { "steamlink" } objdir ( _buildDir .. "steamlink/obj") - defines { - "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it. - } + buildoptions { "-marm", "-mfloat-abi=hard", @@ -920,15 +909,6 @@ function toolchain(_buildDir, _subDir) end function strip() - if _OPTIONS["STRIP_SYMBOLS"]~="1" then - return true - end - - configuration { "osx-*", "Release" } - postbuildcommands { - "$(SILENT) echo Stripping symbols.", - "$(SILENT) " .. (_OPTIONS['TOOLCHAIN'] and toolchainPrefix) .. "strip \"$(TARGET)\"", - } configuration { "android-arm", "Release" } postbuildcommands { @@ -957,12 +937,13 @@ function strip() configuration { "mingw*", "x64", "Release" } postbuildcommands { "$(SILENT) echo Stripping symbols.", - "$(SILENT) " .. (_OPTIONS['TOOLCHAIN'] and toolchainPrefix or "$(MINGW64)/bin/") .. "strip -s \"$(TARGET)\"", + "$(SILENT) $(MINGW64)/bin/strip -s \"$(TARGET)\"", } + configuration { "mingw*", "x32", "Release" } postbuildcommands { "$(SILENT) echo Stripping symbols.", - "$(SILENT) " .. (_OPTIONS['TOOLCHAIN'] and toolchainPrefix or "$(MINGW32)/bin/") .. "strip -s \"$(TARGET)\"", + "$(SILENT) $(MINGW32)/bin/strip -s \"$(TARGET)\"" } configuration { "pnacl" } |