summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/nmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-07-03 00:34:08 +0800
committerruki <[email protected]>2021-07-03 00:34:08 +0800
commit9068e48983a41c30a020c302913fbdb4e4c66f9e (patch)
tree1ef415646d3b6e2765c51b4393661575ed90c6ee /xmake/modules/package/tools/nmake.lua
parentc44d6060e82fc332e0f7370398bcbbaed7278543 (diff)
add os.joinenvs
Diffstat (limited to 'xmake/modules/package/tools/nmake.lua')
-rw-r--r--xmake/modules/package/tools/nmake.lua17
1 files changed, 8 insertions, 9 deletions
diff --git a/xmake/modules/package/tools/nmake.lua b/xmake/modules/package/tools/nmake.lua
index d8c40efca..c618531ce 100644
--- a/xmake/modules/package/tools/nmake.lua
+++ b/xmake/modules/package/tools/nmake.lua
@@ -24,17 +24,16 @@ import("core.project.config")
import("core.tool.toolchain")
import("lib.detect.find_tool")
+-- get msvc
+function _get_msvc(package)
+ local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()})
+ assert(msvc:check(), "vs not found!") -- we need check vs envs if it has been not checked yet
+ return msvc
+end
+
-- get the build environments
function buildenvs(package, opt)
- local envs = {}
- for name, values in pairs(toolchain.load("msvc"):runenvs()) do
- local oldvalues = os.getenv(name)
- if oldvalues then
- values = values .. path.envsep() .. oldvalues
- end
- envs[name] = values
- end
- return envs
+ return os.joinenvs(_get_msvc(package):runenvs())
end
-- build package