diff options
Diffstat (limited to 'cortex-m-rt/build.rs')
-rw-r--r-- | cortex-m-rt/build.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cortex-m-rt/build.rs b/cortex-m-rt/build.rs index 1d0160c..918cbfb 100644 --- a/cortex-m-rt/build.rs +++ b/cortex-m-rt/build.rs @@ -1,9 +1,30 @@ +extern crate chrono; +extern crate rustc_version; + use std::env; use std::fs::File; use std::io::Write; use std::path::PathBuf; +use chrono::NaiveDate; + fn main() { + let date: NaiveDate = rustc_version::version_meta() + .unwrap() + .commit_date + .unwrap() + .parse() + .unwrap(); + + if date <= NaiveDate::from_ymd(2017, 12, 26) { + let version = env!("CARGO_PKG_VERSION"); + panic!( + "cortex-m-rt v{} doesn't support nightly-2017-12-27 and older; \ + to use the current nightly switch to v0.3.7", + version + ); + } + let target = env::var("TARGET").unwrap(); has_fpu(&target); |