File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -669,7 +669,15 @@ mod impl_ {
669669 // only need to bother checking x64, making this code a tiny bit simpler.
670670 // Like we do for the Universal CRT, we sort the possibilities
671671 // asciibetically to find the newest one as that is what vcvars does.
672+ // Before doing that, we check the "WindowsSdkDir" and "WindowsSDKVersion"
673+ // environment variables set by vcvars to use the environment sdk version
674+ // if one is already configured.
672675 fn get_sdk10_dir ( ) -> Option < ( PathBuf , String ) > {
676+ if let ( Ok ( root) , Ok ( version) ) = ( env:: var ( "WindowsSdkDir" ) , env:: var ( "WindowsSDKVersion" ) )
677+ {
678+ return Some ( ( root. into ( ) , version. trim_end_matches ( '\\' ) . to_string ( ) ) ) ;
679+ }
680+
673681 let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0" ;
674682 let key = LOCAL_MACHINE . open ( key. as_ref ( ) ) . ok ( ) ?;
675683 let root = key. query_str ( "InstallationFolder" ) . ok ( ) ?;
You can’t perform that action at this time.
0 commit comments