summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-08-15 23:18:56 +0800
committerruki <[email protected]>2020-08-15 23:18:56 +0800
commitb12320f81e7badd3d181555fe094ab0f4015a3f2 (patch)
tree6b778fcce183f26e619aa1ab63cdde4883f1ccfd
parent5c3712c3f7940af3cce30016f259cb55f874d6a2 (diff)
fix path for msvc/2008 on xp
-rw-r--r--xmake/modules/core/tools/link.lua2
-rwxr-xr-xxmake/modules/detect/sdks/find_vstudio.lua10
-rw-r--r--xmake/modules/detect/tools/find_cl.lua4
-rw-r--r--xmake/modules/detect/tools/find_link.lua2
-rw-r--r--xmake/modules/detect/tools/find_rc.lua2
-rw-r--r--xmake/toolchains/msvc/check.lua2
-rw-r--r--xmake/toolchains/msvc/load.lua10
7 files changed, 19 insertions, 13 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index 98dc98982..f6c775014 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -126,7 +126,7 @@ function link(self, objectfiles, targetkind, targetfile, flags, opt)
try
{
function ()
-
+
-- use vstool to link and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528
local program, argv = linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
vstool.runv(program, argv, {envs = self:runenvs()})
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua
index 8add4638c..ea651845b 100755
--- a/xmake/modules/detect/sdks/find_vstudio.lua
+++ b/xmake/modules/detect/sdks/find_vstudio.lua
@@ -114,6 +114,16 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt)
variables["UCRTVersion"] = UCRTVersion
end
+ -- convert path/lib/include to PATH/LIB/INCLUDE
+ variables.PATH = variables.path
+ variables.LIB = variables.lib
+ variables.LIBPATH = variables.libpath
+ variables.INCLUDE = variables.include
+ variables.path = nil
+ variables.lib = nil
+ variables.include = nil
+ variables.libpath = nil
+
-- ok
return variables
end
diff --git a/xmake/modules/detect/tools/find_cl.lua b/xmake/modules/detect/tools/find_cl.lua
index a6f5d2fa6..b0ca7fa4b 100644
--- a/xmake/modules/detect/tools/find_cl.lua
+++ b/xmake/modules/detect/tools/find_cl.lua
@@ -46,12 +46,10 @@ function main(opt)
-- find program version
local version = nil
if program and opt and opt.version then
- opt.command = opt.command or function () local _, info = os.iorun(program); return info end
+ opt.command = opt.command or function () local _, info = os.iorunv(program, {}, {envs = opt.envs}); return info end
opt.parse = opt.parse or function (output) return output:match("Version (%d+%.?%d*%.?%d*.-)%s") end
version = find_programver(program, opt)
end
-
- -- ok?
return program, version
end
diff --git a/xmake/modules/detect/tools/find_link.lua b/xmake/modules/detect/tools/find_link.lua
index 5814cba09..dd6c6a24a 100644
--- a/xmake/modules/detect/tools/find_link.lua
+++ b/xmake/modules/detect/tools/find_link.lua
@@ -43,7 +43,7 @@ function main(opt)
-- init options
opt = opt or {}
opt.check = opt.check or function (program)
-
+
-- find cl
local cl = assert(find_tool("cl", {envs = opt.envs}))
diff --git a/xmake/modules/detect/tools/find_rc.lua b/xmake/modules/detect/tools/find_rc.lua
index aa205c187..372417b17 100644
--- a/xmake/modules/detect/tools/find_rc.lua
+++ b/xmake/modules/detect/tools/find_rc.lua
@@ -78,8 +78,6 @@ function main(opt)
if program and opt and opt.version then
version = find_programver(program, opt)
end
-
- -- ok?
return program, version
end
diff --git a/xmake/toolchains/msvc/check.lua b/xmake/toolchains/msvc/check.lua
index 18111ebc9..6c3b82555 100644
--- a/xmake/toolchains/msvc/check.lua
+++ b/xmake/toolchains/msvc/check.lua
@@ -53,7 +53,7 @@ function _check_vsenv(toolchain)
for _, vsver in ipairs(vsvers) do
local vcvarsall = (vstudio[vsver] or {}).vcvarsall or {}
local vsenv = vcvarsall[toolchain:arch()]
- if vsenv and vsenv.path and vsenv.include and vsenv.lib then
+ if vsenv and vsenv.PATH and vsenv.INCLUDE and vsenv.LIB then
-- save vsenv
config.set("__vcvarsall", vcvarsall)
diff --git a/xmake/toolchains/msvc/load.lua b/xmake/toolchains/msvc/load.lua
index 3b25a298f..7d8b5b152 100644
--- a/xmake/toolchains/msvc/load.lua
+++ b/xmake/toolchains/msvc/load.lua
@@ -49,7 +49,7 @@ function _add_vsenv(toolchain, name)
if vstudio then
vcvarsall = (vstudio[vs] or {}).vcvarsall or {}
vsenv = vcvarsall[arch] or {}
- if vsenv and vsenv.path and vsenv.include and vsenv.lib then
+ if vsenv and vsenv.PATH and vsenv.INCLUDE and vsenv.LIB then
config.set("__vcvarsall", vcvarsall)
end
end
@@ -80,9 +80,9 @@ function main(toolchain)
toolchain:set("toolset", "ex", "lib.exe")
-- add vs environments
- _add_vsenv(toolchain, "path")
- _add_vsenv(toolchain, "lib")
- _add_vsenv(toolchain, "include")
- _add_vsenv(toolchain, "libpath")
+ _add_vsenv(toolchain, "PATH")
+ _add_vsenv(toolchain, "LIB")
+ _add_vsenv(toolchain, "INCLUDE")
+ _add_vsenv(toolchain, "LIBPATH")
end