Skip to content

Commit

Permalink
Merge pull request #5411 from jinke18/dev-jk4
Browse files Browse the repository at this point in the history
fixbug: for cases when WindowsSDKVersion variable is not available
  • Loading branch information
waruqi authored Jul 31, 2024
2 parents fce49a0 + ad6f760 commit cc2a7d0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xmake/modules/detect/sdks/find_vstudio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt)
if WindowsSDKVersion ~= "" then
variables["WindowsSDKVersion"] = WindowsSDKVersion
end
else
-- sometimes the variable `WindowsSDKVersion` is not available
-- then parse it from `WindowsSdkBinPath`, such as: `C:\\Program Files (x86)\\Windows Kits\\8.1\\bin`
local WindowsSdkBinPath = variables["WindowsSdkBinPath"]
if WindowsSdkBinPath then
WindowsSDKVersion = string.match(WindowsSdkBinPath, "\\(%d+%.%d+)\\bin$")
if WindowsSDKVersion then
variables["WindowsSDKVersion"] = WindowsSDKVersion
end
end
end

-- fix UCRTVersion
Expand Down

0 comments on commit cc2a7d0

Please sign in to comment.