summaryrefslogtreecommitdiff
path: root/xmake/modules/core
diff options
context:
space:
mode:
authorJérôme Leclercq <[email protected]>2021-12-02 12:18:43 +0100
committerJérôme Leclercq <[email protected]>2021-12-02 12:18:43 +0100
commit1772c8d130113aabc407f1824919c79e4a0b8488 (patch)
tree025478afc5c53d69d3c635e88319c08e934098ce /xmake/modules/core
parentf29f664a99086e336b40e02dda29d60a22f300e7 (diff)
Cache XMAKE_IN_VSTUDIO
Diffstat (limited to 'xmake/modules/core')
-rw-r--r--xmake/modules/core/tools/cl.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 14bc19544..ba88a0d03 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -375,6 +375,15 @@ function _has_source_dependencies(self)
return has_source_dependencies
end
+function _is_in_vstudio()
+ local is_in_vstudio = _g._IS_IN_VSTUDIO
+ if is_in_vstudio == nil then
+ is_in_vstudio = os.getenv("XMAKE_IN_VSTUDIO")
+ _g._IS_IN_VSTUDIO = is_in_vstudio
+ end
+ return is_in_vstudio
+end
+
-- make the compile arguments list
function compargv(self, sourcefile, objectfile, flags, opt)
@@ -410,7 +419,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
-- 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
+ if _is_in_vstudio() then
compflags = table.join(compflags, "-FC")
end