From f29f664a99086e336b40e02dda29d60a22f300e7 Mon Sep 17 00:00:00 2001 From: Jérôme Leclercq Date: Thu, 2 Dec 2021 11:55:12 +0100 Subject: Add -FC after depends check (fix #1824) --- xmake/modules/core/tools/cl.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index d84f4c7c1..14bc19544 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -34,12 +34,6 @@ function init(self) -- init cxflags self:set("cxflags", "-nologo") - -- we need show full file path to goto error position if xmake is called in vstudio - -- https://github.com/xmake-io/xmake/issues/1049 - if os.getenv("XMAKE_IN_VSTUDIO") then - self:add("cxflags", "-FC") - end - -- init flags map self:set("mapflags", { @@ -413,12 +407,19 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) -- generate includes file local compflags = flags + + -- we need show full file path to goto error position if xmake is called in vstudio + -- https://github.com/xmake-io/xmake/issues/1049 + if os.getenv("XMAKE_IN_VSTUDIO") then + compflags = table.join(compflags, "-FC") + end + if dependinfo then if _has_source_dependencies(self) then depfile = os.tmpfile() - compflags = table.join(flags, "/sourceDependencies", depfile) + compflags = table.join(compflags, "/sourceDependencies", depfile) else - compflags = table.join(flags, "-showIncludes") + compflags = table.join(compflags, "-showIncludes") end end @@ -504,4 +505,3 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) end end end - -- cgit v1.3.1