diff options
| author | Henrik Tjäder <henrik@tjaders.com> | 2020-04-20 13:18:43 +0000 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2020-04-20 16:03:49 +0000 |
| commit | fca678b8744a925aeb186dca9b4696abc1aac50e (patch) | |
| tree | 76585db42308411f50a0cf1aef4535719fd60183 | |
| parent | e870a68893fd0e7a7f544858846fa5e9eac94b4a (diff) | |
Use buildrs for conditional compilation
| -rw-r--r-- | Cargo.toml | 3 | ||||
| -rw-r--r-- | build.rs | 5 | ||||
| -rw-r--r-- | ci/script.sh | 8 |
3 files changed, 16 insertions, 0 deletions
@@ -53,6 +53,9 @@ rtfm-core = "0.3.0" cortex-m-rt = "0.6.9" heapless = "0.5.0" +[build-dependencies] +version_check = "0.9" + [dependencies.microamp] optional = true version = "0.1.0-alpha.2" @@ -1,8 +1,13 @@ use std::env; +use version_check; fn main() { let target = env::var("TARGET").unwrap(); + if version_check::Channel::read().unwrap().is_nightly() { + println!("cargo:rustc-cfg=rustc_is_nightly") + } + if target.starts_with("thumbv6m") { println!("cargo:rustc-cfg=armv6m") } diff --git a/ci/script.sh b/ci/script.sh index 78341e1..5196db7 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -44,6 +44,14 @@ main() { fi if [ $TRAVIS_RUST_VERSION = nightly ]; then + # Tests where required MSRV > 1.36 + local exs=( + t-cfg-resources + ) + for ex in ${exs[@]}; do + cargo check --example $ex --target $T + done + # multi-core compile-pass tests pushd heterogeneous local exs=( |
