diff options
author | 2017-12-29 21:43:39 +0100 | |
---|---|---|
committer | 2017-12-29 21:43:39 +0100 | |
commit | 018d54639de034b127b2396c0aef4467f9c3b7c9 (patch) | |
tree | d162c9cfe25c78b49682f4d9b180fc9087f15907 /cortex-m-rt/build.rs | |
parent | 6082bc6e4bb52a5f6f71ae10f083c9852f359d1f (diff) | |
download | cortex-m-018d54639de034b127b2396c0aef4467f9c3b7c9.tar.gz cortex-m-018d54639de034b127b2396c0aef4467f9c3b7c9.tar.zst cortex-m-018d54639de034b127b2396c0aef4467f9c3b7c9.zip |
adapt to changes in the `start` lang item
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); |