summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-02-28 22:49:12 +0800
committerruki <[email protected]>2025-02-28 22:49:12 +0800
commitd796790592ba9413d7d17877da6fe7806ee410e6 (patch)
tree0cade0c9762f7c0be262b0ba33666570710de5fe
parentd6b1a19b91d8a37cb84d7ddd7df9cc333c1240be (diff)
attempt to select latest version
-rw-r--r--xmake/modules/detect/sdks/find_vstudio.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua
index d48a7af53..501f8d79b 100644
--- a/xmake/modules/detect/sdks/find_vstudio.lua
+++ b/xmake/modules/detect/sdks/find_vstudio.lua
@@ -211,7 +211,7 @@ function find_build_tools(opt)
end
-- load vcvarsall environment variables
-function _load_vcvarsall(vcvarsall, vsver, arch, opt)
+function _load_vcvarsall_impl(vcvarsall, vsver, arch, opt)
opt = opt or {}
-- is VsDevCmd.bat?
@@ -346,6 +346,17 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt)
return variables
end
+function _load_vcvarsall(vcvarsall, vsver, arch, opt)
+ opt = opt or {}
+ local vs_toolset = opt.toolset or opt.vcvars_ver
+ local result = _load_vcvarsall_impl(vcvarsall, vsver, arch, opt)
+ if result and not vs_toolset then
+ -- if no vs toolset version is specified, we default to the latest version.
+ print(result)
+ end
+ return result
+end
+
-- find vstudio for msvc
function _find_vstudio(opt)
opt = opt or {}