@@ -5,7 +5,7 @@ use xtask::{check_blobs, install_targets};
5
5
/// List of all compilation targets we support.
6
6
///
7
7
/// This should generally list all of the bare-metal thumb targets starting at thumbv6.
8
- static TARGETS : & [ & str ] = & [
8
+ static ALL_TARGETS : & [ & str ] = & [
9
9
"thumbv6m-none-eabi" ,
10
10
"thumbv7m-none-eabi" ,
11
11
"thumbv7em-none-eabi" ,
@@ -15,6 +15,15 @@ static TARGETS: &[&str] = &[
15
15
"thumbv8m.main-none-eabihf" ,
16
16
] ;
17
17
18
+ /// Same as the list above, except with all "base" targets that have a reduced feature set removed.
19
+ static NON_BASE_TARGETS : & [ & str ] = & [
20
+ "thumbv7m-none-eabi" ,
21
+ "thumbv7em-none-eabi" ,
22
+ "thumbv7em-none-eabihf" ,
23
+ "thumbv8m.main-none-eabi" ,
24
+ "thumbv8m.main-none-eabihf" ,
25
+ ] ;
26
+
18
27
fn build ( package : & str , target : & str , features : & [ & str ] ) {
19
28
println ! ( "building {} for {} {:?}" , package, target, features) ;
20
29
let mut cargo = Command :: new ( "cargo" ) ;
@@ -34,29 +43,30 @@ fn build(package: &str, target: &str, features: &[&str]) {
34
43
}
35
44
36
45
#[ rustfmt:: skip]
37
- static PACKAGE_FEATURES : & [ ( & str , & [ & str ] ) ] = & [
38
- ( "cortex-m" , & [ "inline-asm" , "cm7-r0p1" ] ) , // no `linker-plugin-lto` since it's experimental
39
- ( "cortex-m-semihosting" , & [ "inline-asm" , "no-semihosting" , "jlink-quirks" ] ) ,
40
- ( "panic-semihosting" , & [ "inline-asm" , "exit" , "jlink-quirks" ] ) ,
46
+ static PACKAGE_FEATURES : & [ ( & str , & [ & str ] , & [ & str ] ) ] = & [
47
+ ( "cortex-m" , ALL_TARGETS , & [ "inline-asm" , "cm7-r0p1" ] ) , // no `linker-plugin-lto` since it's experimental
48
+ ( "cortex-m-semihosting" , ALL_TARGETS , & [ "inline-asm" , "no-semihosting" , "jlink-quirks" ] ) ,
49
+ ( "panic-semihosting" , ALL_TARGETS , & [ "inline-asm" , "exit" , "jlink-quirks" ] ) ,
50
+ ( "panic-itm" , NON_BASE_TARGETS , & [ ] ) ,
41
51
] ;
42
52
43
53
fn check_crates_build ( is_nightly : bool ) {
44
54
// Build all crates for each supported target.
45
- for & target in TARGETS {
46
- // Filters crate features, keeping only those that are supported.
47
- // Relies on all crates in this repo to use the same convention.
48
- let should_use_feature = |feat : & str | {
49
- match feat {
50
- // This is nightly-only, so don't use it on stable.
51
- "inline-asm" => is_nightly,
52
- // This only affects thumbv7em targets.
53
- "cm7-r0p1" => target. starts_with ( "thumbv7em" ) ,
54
-
55
- _ => true ,
56
- }
57
- } ;
55
+ for ( package, targets, all_features) in PACKAGE_FEATURES {
56
+ for target in * targets {
57
+ // Filters crate features, keeping only those that are supported.
58
+ // Relies on all crates in this repo to use the same convention.
59
+ let should_use_feature = |feat : & str | {
60
+ match feat {
61
+ // This is nightly-only, so don't use it on stable.
62
+ "inline-asm" => is_nightly,
63
+ // This only affects thumbv7em targets.
64
+ "cm7-r0p1" => target. starts_with ( "thumbv7em" ) ,
65
+
66
+ _ => true ,
67
+ }
68
+ } ;
58
69
59
- for ( package, all_features) in PACKAGE_FEATURES {
60
70
// Every crate must build with the default feature set.
61
71
build ( package, target, & [ ] ) ;
62
72
@@ -86,7 +96,7 @@ fn main() {
86
96
// Tests execute in the containing crate's root dir, `cd ..` so that we find `asm` etc.
87
97
env:: set_current_dir ( ".." ) . unwrap ( ) ;
88
98
89
- install_targets ( & mut TARGETS . iter ( ) . cloned ( ) , None ) ;
99
+ install_targets ( & mut ALL_TARGETS . iter ( ) . cloned ( ) , None ) ;
90
100
91
101
// Check that the ASM blobs are up-to-date.
92
102
check_blobs ( ) ;
0 commit comments