From 3d7799ec625b672061cec768a817bfbd8e8cdd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Thu, 7 Sep 2017 16:23:43 +0200 Subject: [PATCH] Update build script to match Lua 5.3 and new Premake version --- build/scripts/common.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/build/scripts/common.lua b/build/scripts/common.lua index 68b15b38a..da9facd74 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -128,7 +128,7 @@ function NazaraBuild:Execute() language("C++") location(_ACTION) - if (self.Config["PremakeProject"] and os.is("windows")) then + if (self.Config["PremakeProject"] and os.ishost("windows")) then local commandLine = "premake5.exe " .. table.concat(_ARGV, ' ') project("_PremakeProject") kind("Utility") @@ -477,10 +477,8 @@ function NazaraBuild:LoadConfig() local content = f:read("*a") f:close() - local func, err = loadstring(content) + local func, err = load(content, "Config file", "t", self.Config) if (func) then - setfenv(func, self.Config) - local status, err = pcall(func) if (not status) then print("Failed to load config.lua: " .. err) @@ -607,7 +605,7 @@ function NazaraBuild:LoadConfig() end function NazaraBuild:MakeInstallCommands(infoTable) - if (os.is("windows")) then + if (os.istarget("windows")) then filter("kind:SharedLib") postbuildmessage("Copying " .. infoTable.Name .. " library and its dependencies to install/executable directories...") @@ -739,13 +737,13 @@ function NazaraBuild:Process(infoTable) for platform, defineTable in pairs(v) do platform = string.lower(platform) if (platform == "posix") then - local osname = os.get() + local osname = os.target() if (PosixOSes[osname]) then platform = osname end end - if (os.is(platform)) then + if (os.istarget(platform)) then for k,v in ipairs(defineTable) do table.insert(targetTable, v) end @@ -779,13 +777,14 @@ end function NazaraBuild:PrepareGeneric() flags({ - "C++14", "MultiProcessorCompile", "NoMinimalRebuild", "RelativeLinks", "ShadowedVariables", "UndefinedIdentifiers" }) + + cppdialect("C++14") self:FilterLibDirectory("../extlibs/lib/", libdirs)