diff options
| author | ruki <[email protected]> | 2026-02-04 00:46:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-02-04 00:46:27 +0800 |
| commit | 61a16be436e712b2227dba3ead097a5f821c65db (patch) | |
| tree | feb9f4a10e11420d85237a7ff2b737e422f7e1de | |
| parent | 9f76385286b3efe1e7978c584201abeb21ec8068 (diff) | |
improve tips
| -rw-r--r-- | xmake/modules/detect/sdks/find_vstudio.lua | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 1395ec274..920b9fad2 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -684,7 +684,21 @@ function _show_vstudio_diagnosis_result(vstudio) local found = {} for vsver, msvc in pairs(vstudio) do if type(msvc) == "table" and msvc.version then - table.insert(found, tostring(vsver) .. "(" .. tostring(msvc.version) .. ")") + local toolset + local vcvarsall = msvc.vcvarsall + if type(vcvarsall) == "table" then + for _, envs in pairs(vcvarsall) do + if type(envs) == "table" and envs.VCToolsVersion then + toolset = _strip_toolset_ver(envs.VCToolsVersion) + break + end + end + end + if toolset then + table.insert(found, tostring(vsver) .. "(" .. tostring(msvc.version) .. ", toolset:" .. tostring(toolset) .. ")") + else + table.insert(found, tostring(vsver) .. "(" .. tostring(msvc.version) .. ")") + end else table.insert(found, tostring(vsver)) end @@ -727,10 +741,7 @@ function main(opt) end -- find and cache result - if option.get("diagnosis") then - wprint("Detecting Visual Studio environment (first run uses cache later). If VS is updated, run `xmake global --clean` to refresh.") - cprint("${dim}detecting vstudio environment (toolset: %s, sdk: %s) ...", opt.toolset or "", opt.sdkver or "") - end + cprint("${color.warning}detecting vstudio environment, it will be cached; run `xmake global --clean` if vs updated.") vstudio = _find_vstudio(opt) if vstudio then local mtime = _get_last_mtime(vstudio) |
