@@ -5,7 +5,7 @@ use xtask::{check_blobs, install_targets};
55/// List of all compilation targets we support.
66///
77/// This should generally list all of the bare-metal thumb targets starting at thumbv6.
8- static TARGETS : & [ & str ] = & [
8+ static ALL_TARGETS : & [ & str ] = & [
99 "thumbv6m-none-eabi" ,
1010 "thumbv7m-none-eabi" ,
1111 "thumbv7em-none-eabi" ,
@@ -15,6 +15,15 @@ static TARGETS: &[&str] = &[
1515 "thumbv8m.main-none-eabihf" ,
1616] ;
1717
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+
1827fn build ( package : & str , target : & str , features : & [ & str ] ) {
1928 println ! ( "building {} for {} {:?}" , package, target, features) ;
2029 let mut cargo = Command :: new ( "cargo" ) ;
@@ -34,29 +43,30 @@ fn build(package: &str, target: &str, features: &[&str]) {
3443}
3544
3645#[ 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 , & [ ] ) ,
4151] ;
4252
4353fn check_crates_build ( is_nightly : bool ) {
4454 // 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+ } ;
5869
59- for ( package, all_features) in PACKAGE_FEATURES {
6070 // Every crate must build with the default feature set.
6171 build ( package, target, & [ ] ) ;
6272
@@ -86,7 +96,7 @@ fn main() {
8696 // Tests execute in the containing crate's root dir, `cd ..` so that we find `asm` etc.
8797 env:: set_current_dir ( ".." ) . unwrap ( ) ;
8898
89- install_targets ( & mut TARGETS . iter ( ) . cloned ( ) , None ) ;
99+ install_targets ( & mut ALL_TARGETS . iter ( ) . cloned ( ) , None ) ;
90100
91101 // Check that the ASM blobs are up-to-date.
92102 check_blobs ( ) ;
0 commit comments