[*] Stupid shid

This commit is contained in:
Reece Wilson 2022-03-06 19:07:32 +00:00
parent 4bfaebea6c
commit 3b4d6cccf2

View File

@ -1,77 +1,12 @@
local isUnixPremake = os.host() == "linux" or os.host() == "mac"
local isWin32 = os.host() == "windows"
local isCmakeToolChain = false
local function getExeFileExt()
if isWin32 then
return ".exe"
end
return ""
end
local function testPath(cwd, exe, ext)
local path = cwd .. "/" .. exe .. ext
if (not os.isfile(path)) then
return nil
end
return os.realpath(path)
end
local function getAuBinsForPlatform()
local cwd = auGetAuroraRoot()
if (isUnixPremake) then
cwd = cwd .. auGetSetting("sRelUnixBins")
end
if (isWin32) then
cwd = cwd .. auGetSetting("sRelWin32")
end
return cwd
end
local getPremakeExec = function()
local exec = premake_exe;
if (exec) then
return exec
end
if (isCmakeToolChain) then
premake_exe = auGetSetting("sDefaultCmakePremakeBin")
return premake_exe
return Aurora.Settings.sDefaultCmakePremakeBin
end
if (isUnixPremake or isWin32) then
local cwd = getAuBinsForPlatform()
local ext = getExeFileExt()
local mods = {auGetSetting("sDefaultCmakePremakeBin"), "auroramake", "aumake", "premake5", "genie"}
for k, v in pairs(mods) do
local abs = testPath(cwd, v, ext)
if (abs and isUnixPremake) then
premake_exe = v .. ext
else
premake_exe = abs
end
if (premake_exe) then
return premake_exe
end
end
end
if (isWin32) then
if (_PREMAKE_COMMAND) then
premake_exe = _PREMAKE_COMMAND
return premake_exe
end
end
premake_exe = "premake5"
return premake_exe
return _PREMAKE_COMMAND
end
local addBuildCommand = function(when, scriptType, path, cwdRelToProject, args)
@ -86,8 +21,6 @@ local addBuildCommand = function(when, scriptType, path, cwdRelToProject, args)
if (isCmakeToolChain) then
command = ""
elseif (cdAware and scriptType == "lua") then
command = "cd \"" .. getAuBinsForPlatform() .. "\" && "
elseif (cdAware) then
command = "cd \"" .. cwd .. "\" && "
elseif (host == "windows") then