From 4f95a3d8fbcbadabcecf71fb902c90c75693e433 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 17 Feb 2022 23:32:17 +0800 Subject: fix pdb with spaces --- xmake/modules/core/tools/cl.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xmake/modules/core') diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index b76061cd7..b499542e3 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -112,11 +112,14 @@ function nf_symbols(self, levels, target) end -- check and add symbol output file - local pdbflags = "-Fd" .. (target:is_static() and symbolfile or path.join(symboldir, "compile." .. path.filename(symbolfile))) + -- + -- @note we need use `{}` to wrap it to avoid expand it + -- https://github.com/xmake-io/xmake/issues/2061#issuecomment-1042590085 + local pdbflags = {"-Fd" .. (target:is_static() and symbolfile or path.join(symboldir, "compile." .. path.filename(symbolfile)))} if self:has_flags({"-FS", "-Fd" .. os.nuldev() .. ".pdb"}, "cxflags", { flagskey = "-FS -Fd" }) then - pdbflags = {"-FS", pdbflags} + table.insert(pdbflags, 1, "-FS") end - table.join2(flags, pdbflags) + table.insert(flags, pdbflags) end end return flags -- cgit v1.3.1