From e24195741929fc0f6efc8f67b77503dfcb0b53c2 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Wed, 6 Oct 2021 16:16:49 +0800 Subject: [PATCH] add libbuild_zynq Reviewed-on: https://git.m-labs.hk/M-Labs/artiq-zynq/pulls/141 Co-authored-by: mwojcik Co-committed-by: mwojcik --- src/libbuild_zynq/Cargo.toml | 8 ++++++++ src/libbuild_zynq/lib.rs | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/libbuild_zynq/Cargo.toml create mode 100644 src/libbuild_zynq/lib.rs diff --git a/src/libbuild_zynq/Cargo.toml b/src/libbuild_zynq/Cargo.toml new file mode 100644 index 00000000..b5cc9e66 --- /dev/null +++ b/src/libbuild_zynq/Cargo.toml @@ -0,0 +1,8 @@ +[package] +authors = ["M-Labs"] +name = "build_zynq" +version = "0.0.0" + +[lib] +name = "build_zynq" +path = "lib.rs" diff --git a/src/libbuild_zynq/lib.rs b/src/libbuild_zynq/lib.rs new file mode 100644 index 00000000..6e5c851a --- /dev/null +++ b/src/libbuild_zynq/lib.rs @@ -0,0 +1,13 @@ +use std::fs::File; +use std::io::{BufRead, BufReader}; + +pub fn cfg() { + // Handle rustc-cfg file + let cfg_path = "../../build/rustc-cfg"; + println!("cargo:rerun-if-changed={}", cfg_path); + + let f = BufReader::new(File::open(cfg_path).unwrap()); + for line in f.lines() { + println!("cargo:rustc-cfg={}", line.unwrap()); + } +}