summaryrefslogtreecommitdiff
path: root/xmake/modules/core
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-20 16:07:21 +0800
committerruki <[email protected]>2020-06-20 16:07:21 +0800
commitda2e3b83c53752c43b651effeb273cb72090d7b0 (patch)
tree0a66afa1a6b6facc6753e970fe66c17343650516 /xmake/modules/core
parent281e06a020f7704fe998be52a6ecc2711cfd4fb7 (diff)
add runenvs for cl/link
Diffstat (limited to 'xmake/modules/core')
-rw-r--r--xmake/modules/core/tools/cl.lua3
-rw-r--r--xmake/modules/core/tools/link.lua9
2 files changed, 7 insertions, 5 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 9f6421c21..3dfa0bb0f 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -353,7 +353,8 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
end
-- use vstool to compile and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528
- return vstool.iorunv(compargv(self, sourcefile, objectfile, compflags, opt))
+ local program, argv = compargv(self, sourcefile, objectfile, compflags, opt)
+ return vstool.iorunv(program, argv, {envs = self:runenvs()})
end,
catch
{
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index 3bcbb238d..8d1f9083d 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -29,10 +29,10 @@ function init(self)
self:set("ldflags", "-nologo", "-dynamicbase", "-nxcompat")
-- init arflags
- self:set("arflags", "-nologo")
+ self:set("arflags", "-lib", "-nologo")
-- init shflags
- self:set("shflags", "-nologo")
+ self:set("shflags", "-dll", "-nologo")
-- init flags map
self:set("mapflags",
@@ -52,7 +52,7 @@ function get(self, name)
local values = self._INFO[name]
if name == "ldflags" or name == "arflags" or name == "shflags" then
-- switch architecture, @note does cache it in init() for generating vs201x project
- values = table.join(values, "-machine:" .. (config.arch() or "x86"))
+ values = table.join(values, "-machine:" .. (self:arch() or "x86"))
end
return values
end
@@ -108,7 +108,8 @@ function link(self, objectfiles, targetkind, targetfile, flags, opt)
function ()
-- use vstool to link and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528
- vstool.runv(linkargv(self, objectfiles, targetkind, targetfile, flags, opt))
+ local program, argv = linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
+ vstool.runv(program, argv, {envs = self:runenvs()})
end,
catch
{