[*] Harden

This commit is contained in:
Reece Wilson 2023-12-19 04:16:12 +00:00
parent 9724a3eb35
commit 1768d90d6a
4 changed files with 34 additions and 33 deletions

View File

@ -1,5 +1,6 @@
local isUnixPremake = os.host() == "linux" or os.host() == "mac"
local isCmakeToolChain = false
local isWin32Make = os.host() == "windows" and _ACTION == "gmake2"
local getPremakeExec = function()
if (isCmakeToolChain) then
@ -19,7 +20,7 @@ local addBuildCommand = function(when, scriptType, path, cwdRelToProject, args)
local command = ""
if (isCmakeToolChain) then
if (isCmakeToolChain or isWin32Make) then
command = ""
elseif (cdAware) then
command = "cd \"" .. cwd .. "\" && "

View File

@ -7,8 +7,9 @@ end
-- file name, type, directory, extension, is windows, configuration, real name
local function formatCpy(name, type, dir, ex, iswin, config, platformName, arch, realName)
local pathSuffix = "";
local hack2 = os.host() == "windows" and _ACTION == "gmake2"
if (iswin) then
if (iswin and not hack2) then
pathSuffix = "*\"";
else
pathSuffix = "\"";
@ -26,8 +27,13 @@ local function formatCpy(name, type, dir, ex, iswin, config, platformName, arch,
local outputPath = string.format("%s/%s%s", dir, name, ex)
local outputTarget = string.format("%s/%s", dir, name)
local uglyBuildPath = string.format("%%{cfg.targetdir}/%s%s", name, ex)
local hack = "{COPY}"
return string.format("{COPY} \"%s\" \"%s%s", uglyBuildPath, outputPath, pathSuffix), outputPath, uglyBuildPath
if (hack2) then
hack = "cp -rf"
end
return string.format("%s \"%s\" \"%s%s", hack, uglyBuildPath, outputPath, pathSuffix), outputPath, uglyBuildPath
end
local function gnuCoreUtilsMkdirRecursive(dir)

View File

@ -93,24 +93,12 @@ local function setBestDebugDir(dest)
end
local function configureProjectForCompiler()
if (targetingCmake) then
filter {"toolset:msc"}
end
if (bugHack) then
buildoptions {"-utf-8"}
end
filter {}
if (targetingCmake) then
filter {"toolset:msc", "files:**.cpp or files:**.cc or files:**.cxx"}
elseif (bugHack) then
filter {"files:**.cpp or files:**.cc or files:**.cxx"}
end
if (bugHack) then
buildoptions {"/experimental:module-", "/Zc:__cplusplus"}
end
filter {}
end
@ -134,13 +122,18 @@ local function configureProjectForPlatform(platform, projectType)
staticruntime("Off")
end
if (not Aurora.Settings.bBasicMitigations) then
flags "NoBufferSecurityCheck"
end
defines "_CRT_SECURE_NO_WARNINGS"
filter {"toolset:msc"}
if (not Aurora.Settings.bBasicMitigations) then
buildoptions {
--"/GS-",
"/sdl-"
}
flags "NoBufferSecurityCheck"
end
if (Aurora.Settings.bHotswap) then
@ -149,7 +142,7 @@ local function configureProjectForPlatform(platform, projectType)
justmycode("Off")
end
defines "_CRT_SECURE_NO_WARNINGS"
filter {}
else
if ((projectType == "SharedLib") or
(projectType == "StaticLib")) then

View File

@ -57,7 +57,8 @@ local function auStartSolution(sln)
end
end)
if (Aurora.Settings.bForceLLVMStl) then
local gmakeOnWin32 = os.host() == "windows" and _ACTION == "gmake2"
if (Aurora.Settings.bForceLLVMStl and not gmakeOnWin32) then
auFilter {"files:**.cpp or files:**.cc or files:**.cxx", "toolset:clang"}
buildoptions {"-stdlib=libc++"}
auFilter{}