File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ pub enum Feature {
51
51
Logger ,
52
52
PanicOnLoggerErrors ,
53
53
Unstable ,
54
+ UnstableAlloc ,
54
55
55
56
// `uefi-services` features.
56
57
PanicHandler ,
@@ -69,6 +70,7 @@ impl Feature {
69
70
Self :: Logger => "logger" ,
70
71
Self :: PanicOnLoggerErrors => "panic-on-logger-errors" ,
71
72
Self :: Unstable => "unstable" ,
73
+ Self :: UnstableAlloc => "unstable_alloc" ,
72
74
73
75
Self :: PanicHandler => "uefi-services/panic_handler" ,
74
76
Self :: Qemu => "uefi-services/qemu" ,
@@ -99,6 +101,11 @@ impl Feature {
99
101
vec ! [ Self :: GlobalAllocator , Self :: Alloc , Self :: Logger ]
100
102
}
101
103
104
+ /// Set of features that enables more code in the root uefi crate.
105
+ pub fn more_code_unstable ( ) -> Vec < Self > {
106
+ vec ! [ Self :: Unstable , Self :: UnstableAlloc ]
107
+ }
108
+
102
109
fn comma_separated_string ( features : & [ Feature ] ) -> String {
103
110
features
104
111
. iter ( )
Original file line number Diff line number Diff line change @@ -45,9 +45,15 @@ fn build(opt: &BuildOpt) -> Result<()> {
45
45
return build_feature_permutations ( opt) ;
46
46
}
47
47
48
+ let mut features = Feature :: more_code ( ) ;
49
+
50
+ if opt. unstable_features {
51
+ features. extend ( Feature :: more_code_unstable ( ) )
52
+ }
53
+
48
54
let cargo = Cargo {
49
55
action : CargoAction :: Build ,
50
- features : Feature :: more_code ( ) ,
56
+ features,
51
57
packages : Package :: all_except_xtask ( ) ,
52
58
release : opt. build_mode . release ,
53
59
target : Some ( * opt. target ) ,
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ pub struct BuildOpt {
63
63
#[ clap( flatten) ]
64
64
pub build_mode : BuildModeOpt ,
65
65
66
+ /// Tells whether unstable features should be activated.
67
+ #[ clap( long, action) ]
68
+ pub unstable_features : bool ,
69
+
66
70
/// Build multiple times to check that different feature
67
71
/// combinations work.
68
72
#[ clap( long, action) ]
You can’t perform that action at this time.
0 commit comments