summaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorAdit Cahya Ramadhan <matematika.adit@gmail.com>2017-11-13 22:40:30 +0700
committerDavid Peter <sharkdp@users.noreply.github.com>2017-11-13 19:27:51 +0100
commit673392045fe2209797b77c8525804bc4864cfd28 (patch)
tree727b6bd4cb6e0029272ee2a14a43a87d56595fb0 /build.rs
parent26f71dd21a122df8476f75ca5bc979d37d734d1f (diff)
Check minimal rustc version on the build process
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 8e6fe68..aa7f03d 100644
--- a/build.rs
+++ b/build.rs
@@ -8,12 +8,25 @@
#[macro_use]
extern crate clap;
+extern crate version_check;
use clap::Shell;
+use std::io::{self, Write};
+use std::process::exit;
include!("src/app.rs");
fn main() {
+ match version_check::is_min_version("1.19") {
+ // rustc >= 1.19
+ Some((true, _)) => {}
+ // rustc < 1.19 or can't figure it out
+ _ => {
+ writeln!(&mut io::stderr(), "This crate requires rustc >= 1.19").unwrap();
+ exit(1);
+ }
+ }
+
let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));
let outdir = match var {
None => return,