Skip to content

Commit f51150f

Browse files
authored
Merge pull request #10240 from Steelskin/fabrice/cherry-pick-win-sdk-version
🍒 [WindowsDriver] Always consider `WinSdkVersion` (llvm#130377)
2 parents 39e5419 + c918de0 commit f51150f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/lib/WindowsDriver/MSVCPaths.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,13 @@ bool getWindowsSDKDir(vfs::FileSystem &VFS, std::optional<StringRef> WinSdkDir,
444444
return !WindowsSDKLibVersion.empty();
445445
}
446446
if (Major == 10) {
447+
if (WinSdkVersion) {
448+
// Use the user-provided version as-is.
449+
WindowsSDKIncludeVersion = WinSdkVersion->str();
450+
WindowsSDKLibVersion = WindowsSDKIncludeVersion;
451+
return true;
452+
}
453+
447454
if (!getWindows10SDKVersionFromPath(VFS, Path, WindowsSDKIncludeVersion))
448455
return false;
449456
WindowsSDKLibVersion = WindowsSDKIncludeVersion;
@@ -475,6 +482,12 @@ bool getUniversalCRTSdkDir(vfs::FileSystem &VFS,
475482
Path, nullptr))
476483
return false;
477484

485+
if (WinSdkVersion) {
486+
// Use the user-provided version as-is.
487+
UCRTVersion = WinSdkVersion->str();
488+
return true;
489+
}
490+
478491
return getWindows10SDKVersionFromPath(VFS, Path, UCRTVersion);
479492
}
480493

0 commit comments

Comments
 (0)