Build/Public/premake5.lua

68 lines
1.8 KiB
Lua
Raw Normal View History

premake.path = premake.path .. ";" .. os.realpath(path.translate("..\\"))
2022-07-18 15:47:59 +00:00
require("../Core/Premake/Premake")
require("base")
-------------------------------------------------------
-- run a user script that should be able to directly access
-- the global aurora variable with the util apis available
-------------------------------------------------------
if (os.isfile("../../preconfig.lua")) then
require("../../preconfig")
end
-------------------------------------------------------
-- print build platform
-------------------------------------------------------
local isWin = os.host() == "windows"
local isToolChain = false
local isUnix = false
local toolPlatforms = {"win32", "linux", "mac"}
local unixPlatforms = {"linux", "mac"}
for k in pairs(toolPlatforms) do
if (os.host() == k) then
isToolChain = true
end
end
for k in pairs(unixPlatforms) do
if (os.host() == k) then
isUnix = true
end
end
auPrintHeader("configuration", "platforms")
print("isWin", isWin)
print("isUnix", isUnix)
print("isDevelopmentPlatform", isToolChain)
print()
-------------------------------------------------------
-- start
-------------------------------------------------------
local function start()
auStart()
if (os.isfile("../../premake5.lua")) then
require("../../premake5")
elseif (os.isfile("../../AuroraSolution.lua")) then
require("../../AuroraSolution")
elseif (os.isfile("../../AuroraSolution.json")) then
local result, err = json.decode(io.readfile("../../AuroraSolution.json"))
if (not result) then
auFatal("AuroraSolution.json parse error", err)
return
end
auProcessSolutionByJsonDocument(result)
else
auFatal("No solution file found in the root")
end
end
xpcall(start, auFatal)