@@ -280,8 +280,8 @@ pub struct Target {
280
280
pub ranlib : Option < PathBuf > ,
281
281
pub linker : Option < PathBuf > ,
282
282
pub ndk : Option < PathBuf > ,
283
- pub sanitizers : bool ,
284
- pub profiler : bool ,
283
+ pub sanitizers : Option < bool > ,
284
+ pub profiler : Option < bool > ,
285
285
pub crt_static : Option < bool > ,
286
286
pub musl_root : Option < PathBuf > ,
287
287
pub musl_libdir : Option < PathBuf > ,
@@ -896,8 +896,8 @@ impl Config {
896
896
target. musl_libdir = cfg. musl_libdir . map ( PathBuf :: from) ;
897
897
target. wasi_root = cfg. wasi_root . map ( PathBuf :: from) ;
898
898
target. qemu_rootfs = cfg. qemu_rootfs . map ( PathBuf :: from) ;
899
- target. sanitizers = cfg. sanitizers . unwrap_or ( build . sanitizers . unwrap_or_default ( ) ) ;
900
- target. profiler = cfg. profiler . unwrap_or ( build . profiler . unwrap_or_default ( ) ) ;
899
+ target. sanitizers = cfg. sanitizers ;
900
+ target. profiler = cfg. profiler ;
901
901
902
902
config. target_config . insert ( TargetSelection :: from_user ( & triple) , target) ;
903
903
}
@@ -1008,19 +1008,19 @@ impl Config {
1008
1008
}
1009
1009
1010
1010
pub fn sanitizers_enabled ( & self , target : TargetSelection ) -> bool {
1011
- self . target_config . get ( & target) . map ( |t| t. sanitizers ) . unwrap_or ( self . sanitizers )
1011
+ self . target_config . get ( & target) . map ( |t| t. sanitizers ) . flatten ( ) . unwrap_or ( self . sanitizers )
1012
1012
}
1013
1013
1014
1014
pub fn any_sanitizers_enabled ( & self ) -> bool {
1015
- self . target_config . values ( ) . any ( |t| t. sanitizers ) || self . sanitizers
1015
+ self . target_config . values ( ) . any ( |t| t. sanitizers == Some ( true ) ) || self . sanitizers
1016
1016
}
1017
1017
1018
1018
pub fn profiler_enabled ( & self , target : TargetSelection ) -> bool {
1019
- self . target_config . get ( & target) . map ( |t| t. profiler ) . unwrap_or ( self . profiler )
1019
+ self . target_config . get ( & target) . map ( |t| t. profiler ) . flatten ( ) . unwrap_or ( self . profiler )
1020
1020
}
1021
1021
1022
1022
pub fn any_profiler_enabled ( & self ) -> bool {
1023
- self . target_config . values ( ) . any ( |t| t. profiler ) || self . profiler
1023
+ self . target_config . values ( ) . any ( |t| t. profiler == Some ( true ) ) || self . profiler
1024
1024
}
1025
1025
1026
1026
pub fn llvm_enabled ( & self ) -> bool {
0 commit comments