diff options
| author | ruki <[email protected]> | 2026-02-01 11:39:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-02-01 11:39:30 +0800 |
| commit | a153273143ef8d3b8d43b6eb5b6b2dfb7c02944b (patch) | |
| tree | 35e8f7f4005d15e99e7641ddabe1a41229d7de2b | |
| parent | b86a88d31acbf64c4e6b5b2137c08d7b5b179b39 (diff) | |
improve to check envs
| -rw-r--r-- | xmake/modules/detect/sdks/find_vstudio.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 488615a3f..c898657a1 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -313,6 +313,9 @@ function _load_vcvarsall_impl(vcvarsall, vsver, arch, opt) variables[name] = value end end + + -- check if the environment variables are truncated + _check_vcvarsall_env(variables) if not variables.path then return end @@ -394,7 +397,7 @@ function _check_vcvarsall_env(vars) value_org = os.getenv(name) _env_orgs[name] = value_org or false end - local value_new = vars[name] + local value_new = vars[name] or vars[name:lower()] if value_org and value_new and #value_org > 0 then -- we only check the first/last 512 bytes to verify if the original path is present -- because the path maybe too long and be truncated @@ -444,9 +447,6 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt) result = _load_vcvarsall_impl(vcvarsall, vsver, arch, opt) end end - if result then - _check_vcvarsall_env(result) - end return result end |
