summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Leclercq <[email protected]>2021-12-02 12:21:16 +0100
committerJérôme Leclercq <[email protected]>2021-12-02 12:21:16 +0100
commit5bd0628dace1c00671055e03d26b8de180e223ac (patch)
tree87a9428ea0c29f0c8457a1327dd389959edf257a
parent1772c8d130113aabc407f1824919c79e4a0b8488 (diff)
Don't copy table everytime
-rw-r--r--xmake/modules/core/tools/cl.lua20
1 files changed, 12 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index ba88a0d03..b8beceac1 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -417,18 +417,22 @@ 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 _is_in_vstudio() then
- compflags = table.join(compflags, "-FC")
- end
-
if dependinfo then
if _has_source_dependencies(self) then
depfile = os.tmpfile()
- compflags = table.join(compflags, "/sourceDependencies", depfile)
+ compflags = table.join(flags, "/sourceDependencies", depfile)
+ else
+ compflags = table.join(flags, "-showIncludes")
+ end
+ end
+
+ -- 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 _is_in_vstudio() then
+ if compflags == flags then
+ compflags = table.join(flags, "-FC")
else
- compflags = table.join(compflags, "-showIncludes")
+ table.join2(compflags, "-FC")
end
end