From 091bb280433a66049ccab4bdfed2f7cd4c387141 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 5 Sep 2017 21:13:04 +0800 Subject: [PATCH] libboard: use libbuild_artiq --- artiq/firmware/libboard/Cargo.toml | 3 +++ artiq/firmware/libboard/build.rs | 14 ++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/artiq/firmware/libboard/Cargo.toml b/artiq/firmware/libboard/Cargo.toml index 950fbcff2..e3fed9298 100644 --- a/artiq/firmware/libboard/Cargo.toml +++ b/artiq/firmware/libboard/Cargo.toml @@ -8,6 +8,9 @@ build = "build.rs" name = "board" path = "lib.rs" +[build-dependencies] +build_artiq = { path = "../libbuild_artiq" } + [dependencies] log = { version = "0.3", default-features = false } diff --git a/artiq/firmware/libboard/build.rs b/artiq/firmware/libboard/build.rs index a7b0335e5..84aa97652 100644 --- a/artiq/firmware/libboard/build.rs +++ b/artiq/firmware/libboard/build.rs @@ -1,15 +1,5 @@ -use std::env; -use std::path::Path; -use std::io::{BufRead, BufReader}; -use std::fs::File; +extern crate build_artiq; fn main() { - let out_dir = env::var("BUILDINC_DIRECTORY").unwrap(); - let cfg_path = Path::new(&out_dir).join("generated").join("rust-cfg"); - println!("cargo:rerun-if-changed={}", cfg_path.to_str().unwrap()); - - let f = BufReader::new(File::open(&cfg_path).unwrap()); - for line in f.lines() { - println!("cargo:rustc-cfg={}", line.unwrap()); - } + build_artiq::misoc_cfg(); }