From ef1d2633e5c9bd8aeb71434b3d7b67a896df5e39 Mon Sep 17 00:00:00 2001 From: J Reece Wilson Date: Sun, 27 Aug 2023 12:45:28 +0100 Subject: [PATCH] [*] Amended bStaticRuntime on Linux and Windows [+] Aurora.Settings.bBasicMitigations for Windows --- Core/project.lua | 20 +++++++++++++++++++- Core/solution.lua | 13 ++++++++++--- Public/settings.lua | 1 + 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Core/project.lua b/Core/project.lua index 633a1dd..ac727f9 100644 --- a/Core/project.lua +++ b/Core/project.lua @@ -115,16 +115,34 @@ local function configureProjectForCompiler() end local function configureProjectForPlatform(platform, projectType) - if (platform == "win32") then + if (platform == "linux") then + if (Aurora.Settings.bStaticRuntime) then + buildoptions "-static" + linkoptions "-l:libc++abi.a" + linkoptions "-l:libc++.a" + linkoptions "-Wl,--as-needed" + end + end + if (platform == "win32") then characterset(Aurora.Settings.sMsvcDefCharset) if (Aurora.Settings.bStaticRuntime) then staticruntime("On") + links "libucrt.lib" else staticruntime("Off") end + if (not Aurora.Settings.bBasicMitigations) then + buildoptions { + --"/GS-", + "/sdl-" + } + + flags "NoBufferSecurityCheck" + end + if (Aurora.Settings.bHotswap) then justmycode("On") else diff --git a/Core/solution.lua b/Core/solution.lua index b4e3009..88b5728 100644 --- a/Core/solution.lua +++ b/Core/solution.lua @@ -64,12 +64,19 @@ local function auStartSolution(sln) auFilter { "toolset:clang"} linkoptions {"-nodefaultlibs"} - links {"c++", - "c++abi", + links { "m", "c", "gcc_s", - "gcc"} + "gcc" + } + + if (Aurora.Settings.bStaticRuntime) then + links { + "c++", + "c++abi" + } + end auFilter {} end end diff --git a/Public/settings.lua b/Public/settings.lua index aac1e93..b7ecccc 100644 --- a/Public/settings.lua +++ b/Public/settings.lua @@ -97,6 +97,7 @@ auSetDefault(settings, "bDefinePartialABIInTargetName", true) auSetDefault(settings, "bStaticRuntime", true) +auSetDefault(settings, "bBasicMitigations", true) -- auSetDefault(settings, "bLTO", false)