diff options
| author | ruki <[email protected]> | 2026-02-01 12:55:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-02-01 12:55:44 +0800 |
| commit | 609c7ebe102b01068a8e6bfa201c99fb660d8fc7 (patch) | |
| tree | 335fe4be727a604591e5baa72e0bd362da2284b8 | |
| parent | 58ca9ee7a7bb05fe5a8706f9c3966ded3534163f (diff) | |
improve check
| -rw-r--r-- | xmake/modules/detect/sdks/find_vstudio.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 82cdfb643..b39c216ad 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -391,7 +391,10 @@ end -- check if the environment variables are truncated -- https://github.com/xmake-io/xmake/issues/7281 function _check_vcvarsall_env(vars) - local check_vars = {"PATH", "INCLUDE", "LIB", "LIBPATH"} + if not option.get("diagnosis") then + return + end + local check_vars = {"PATH", "INCLUDE", "LIBPATH"} for _, name in ipairs(check_vars) do local value_org = _env_orgs[name] if value_org == nil then @@ -408,12 +411,10 @@ function _check_vcvarsall_env(vars) local values_new = hashset.from(path.splitenv(value_new)) for _, p in ipairs(value_org) do if not values_new:has(p) then - if option.get("diagnosis") then - if #p > 256 then - p = p:sub(1, 256) .. "..." - end - wprint("%%%s%% is too long and truncated, detect msvc may be failed, please clear some unused variables!\n > %s", name, p) + if #p > 256 then + p = p:sub(1, 256) .. "..." end + cprint("${color.warning}%%%s%% is too long and truncated, detect msvc may be failed, please clear some unused variables!\n > %s", name, p) break end end |
