summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-18 00:49:28 +0800
committerruki <[email protected]>2020-11-18 00:49:28 +0800
commitb7aee98613d00f768010cdf95273a9bf129ad906 (patch)
treeb5795035081605f12874e0f359c55f87b6f5575d
parent3755fe7dce45586dbe9c72b62358a08bc5d07e5c (diff)
show full file path in vscode
-rw-r--r--xmake/modules/core/tools/cl.lua6
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.targets1
2 files changed, 7 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 371fcf6aa..f5fac3cb2 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -33,6 +33,12 @@ 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",
{
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
index 0519c2762..bbd174713 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
@@ -70,6 +70,7 @@
set XMAKE_CONFIGDIR=$(XmakeConfigDirResolved.TrimEnd('/\'.ToCharArray()))
set XMAKE_PROGRAM_DIR=$(XmakeProgramDirResolved.TrimEnd('/\'.ToCharArray()))
set XMAKE_SKIP_HISTORY=1
+ set XMAKE_IN_VSTUDIO=1
</_XmakeEnv>
<_XmakeEnv Condition="$(XmakeDiagnosis)">
$(_XmakeEnv)