aboutsummaryrefslogtreecommitdiffstats
path: root/support/rust-task_info/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/rust-task_info/build.rs')
-rw-r--r--support/rust-task_info/build.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/support/rust-task_info/build.rs b/support/rust-task_info/build.rs
new file mode 100644
index 00000000000..e4341cdab46
--- /dev/null
+++ b/support/rust-task_info/build.rs
@@ -0,0 +1,21 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#![feature(env)]
+#![feature(io)]
+
+use std::old_io::process::{Command, ProcessExit, StdioContainer};
+use std::env;
+
+fn main() {
+ let out_dir = env::var_string("OUT_DIR").unwrap();
+ let result = Command::new("make")
+ .args(&["-f", "makefile.cargo"])
+ .stdout(StdioContainer::InheritFd(1))
+ .stderr(StdioContainer::InheritFd(2))
+ .status()
+ .unwrap();
+ assert_eq!(result, ProcessExit::ExitStatus(0));
+ println!("cargo:rustc-flags=-L native={}", out_dir);
+}