diff options
| author | ruki <[email protected]> | 2021-10-22 22:39:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-22 22:39:26 +0800 |
| commit | 5d3b5637a39d3f89dbe7891d0eacf3e028578818 (patch) | |
| tree | aada1020fb05041040e77c2cf1ab56c7f0cbe75d /xmake/modules/core/tools/nim.lua | |
| parent | 72f482c4d675e4e82b6d37c10428de47f25d9b45 (diff) | |
pass msvc envs to nim
Diffstat (limited to 'xmake/modules/core/tools/nim.lua')
| -rw-r--r-- | xmake/modules/core/tools/nim.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xmake/modules/core/tools/nim.lua b/xmake/modules/core/tools/nim.lua index b76fcb4ea..d142e3f0e 100644 --- a/xmake/modules/core/tools/nim.lua +++ b/xmake/modules/core/tools/nim.lua @@ -84,8 +84,8 @@ function nf_symbol(self, level) end -- make the strip flag -function nf_strip(self, level) - if is_plat("linux", "macosx", "bsd") then +function nf_strip(self, level, target) + if target:is_plat("linux", "macosx", "bsd") then if level == "debug" or level == "all" then return "--passL:-s" end @@ -103,8 +103,12 @@ function nf_link(self, lib) end -- make the linkdir flag -function nf_linkdir(self, dir) - return {"--passL:-L" .. path.translate(dir)} +function nf_linkdir(self, dir, target) + if target:is_plat("windows") then + return {"--passL:-libpath:" .. path.translate(dir)} + else + return {"--passL:-L" .. path.translate(dir)} + end end -- make the build arguments list @@ -128,6 +132,7 @@ end -- build the target file function build(self, sourcefiles, targetkind, targetfile, flags) os.mkdir(path.directory(targetfile)) - os.runv(buildargv(self, sourcefiles, targetkind, targetfile, flags)) + local program, argv = buildargv(self, sourcefiles, targetkind, targetfile, flags) + os.runv(program, argv, {envs = self:runenvs()}) end |
