summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-08-20 14:38:39 +0800
committerOpportunityLiu <[email protected]>2019-08-20 14:38:39 +0800
commita0d6bcacb190ce0538ded1c15336b6abdafbb7c2 (patch)
tree1249c19309cdc30f3a99c9dd7180c7ca5065d798 /xmake/plugins
parent22a22766a667c3273fc4a4a2e58ce55aba8466b3 (diff)
support set_runenv
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua14
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.targets1
2 files changed, 12 insertions, 3 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index d029a8a4b..53200dd2c 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -176,10 +176,18 @@ function _make_targetinfo(mode, arch, target)
-- save runenvs
local runenvs = {}
for k, v in pairs(target:get("runenvs")) do
- local defs = table.imap(v, function(_, v) return vformat(v) end)
- table.insert(runenvs, format("%s=%s", k, path.joinenv(defs)))
+ local defs = table.imap(table.wrap(v), function(_, v) return vformat(v) end)
+ runenvs[k] = format("%s;$([System.Environment]::GetEnvironmentVariable('%s'))", path.joinenv(defs), k)
end
- targetinfo.runenvs = table.concat(runenvs, "\n")
+ for k, v in pairs(target:get("runenv")) do
+ local defs = table.imap(table.wrap(v), function(_, v) return vformat(v) end)
+ runenvs[k] = path.joinenv(defs)
+ end
+ local runenvstr = {}
+ for k, v in pairs(runenvs) do
+ table.insert(runenvstr, k .. "=" .. v)
+ end
+ targetinfo.runenvs = table.concat(runenvstr, "\n")
-- use mfc? save the mfc runtime kind
if target:rule("win.sdk.mfc.shared_app") or target:rule("win.sdk.mfc.shared") then
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
index 0a74e5f45..99583bf74 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
@@ -130,6 +130,7 @@ MSBuild Properties:
XmakeIncludeDirs: $(XmakeIncludeDirs)
XmakeLinkDirs: $(XmakeLinkDirs)
XmakeSourceDirs: $(XmakeSourceDirs)
+ XmakeRunEnvs: $(XmakeRunEnvs)
Xmake Path:
XmakeProgramDir: $(XmakeProgramDir)
XmakeProjectDir: $(XmakeProjectDir)