From 120d4215813c6ac256926ebc99ab2f4404419c8a Mon Sep 17 00:00:00 2001 From: Sharlock93 Date: Sun, 22 Oct 2023 18:49:57 +0100 Subject: [PATCH] Moving /Fp flag to shared Moving /Fp flag from being a standalone function to shared flags. --- src/tools/msc.lua | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/tools/msc.lua b/src/tools/msc.lua index ed3f12643..0c0badf83 100644 --- a/src/tools/msc.lua +++ b/src/tools/msc.lua @@ -41,6 +41,14 @@ -- Returns list of C compiler flags for a configuration. -- + local function getPchOutputFileFlag(cfg) + local res = ''; + if cfg.pchoutputfile then + res = '/Fp' .. p.quoted(cfg.pchoutputfile) + end + return res + end + local function getRuntimeFlag(cfg, isstatic) local rt = cfg.runtime local flag = iif(isstatic, "/MT", "/MD") @@ -155,7 +163,10 @@ usestandardpreprocessor = { On = "/Zc:preprocessor", Off = "/Zc:preprocessor-" - } + }, + pchoutputfile = { + _ = function (cfg) return getPchOutputFileFlag(cfg) end + } } @@ -485,24 +496,3 @@ return result end - - --- --- Get precompiled header output filename --- --- @param cfg --- Project configuration --- @return --- The precompiled header's output file name --- - - function msc.getpchoutputfile(cfg) - local res = {} - - if(cfg.pchoutputfile) then - table.insert(res, '/Fp' .. p.quoted(cfg.pchoutputfile)) - else - - return res - end -