@@ -256,6 +256,16 @@ pub fn find_vs_version() -> Result<VsVers, String> {
256
256
}
257
257
}
258
258
259
+ /// To find the Universal CRT we look in a specific registry key for where
260
+ /// all the Universal CRTs are located and then sort them asciibetically to
261
+ /// find the newest version. While this sort of sorting isn't ideal, it is
262
+ /// what vcvars does so that's good enough for us.
263
+ ///
264
+ /// Returns a pair of (root, version) for the ucrt dir if found
265
+ pub fn get_ucrt_dir ( ) -> Option < ( PathBuf , String ) > {
266
+ impl_:: get_ucrt_dir ( )
267
+ }
268
+
259
269
/// Windows Implementation.
260
270
#[ cfg( windows) ]
261
271
mod impl_ {
@@ -997,7 +1007,7 @@ mod impl_ {
997
1007
// what vcvars does so that's good enough for us.
998
1008
//
999
1009
// Returns a pair of (root, version) for the ucrt dir if found
1000
- fn get_ucrt_dir ( ) -> Option < ( PathBuf , String ) > {
1010
+ pub ( super ) fn get_ucrt_dir ( ) -> Option < ( PathBuf , String ) > {
1001
1011
let key = r"SOFTWARE\Microsoft\Windows Kits\Installed Roots" ;
1002
1012
let key = LOCAL_MACHINE . open ( key. as_ref ( ) ) . ok ( ) ?;
1003
1013
let root = key. query_str ( "KitsRoot10" ) . ok ( ) ?;
@@ -1400,7 +1410,7 @@ mod impl_ {
1400
1410
/// Non-Windows Implementation.
1401
1411
#[ cfg( not( windows) ) ]
1402
1412
mod impl_ {
1403
- use std:: { env, ffi:: OsStr } ;
1413
+ use std:: { env, ffi:: OsStr , path :: PathBuf } ;
1404
1414
1405
1415
use super :: { EnvGetter , TargetArch } ;
1406
1416
use crate :: Tool ;
@@ -1488,4 +1498,9 @@ mod impl_ {
1488
1498
pub ( super ) fn has_msbuild_version ( _version : & str , _: & dyn EnvGetter ) -> bool {
1489
1499
false
1490
1500
}
1501
+
1502
+ #[ inline( always) ]
1503
+ pub ( super ) fn get_ucrt_dir ( ) -> Option < ( PathBuf , String ) > {
1504
+ None
1505
+ }
1491
1506
}
0 commit comments