about summary refs log tree commit diff
path: root/src/liballoc_jemalloc/build.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-01-21 15:36:25 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-02-11 11:12:32 -0800
commiteac0a8bc3070e45047fff57e7b024a059289a36d (patch)
treecbcaa9dc371f2b11fe2e9b9d3ee7a3f7a9cfdb8e /src/liballoc_jemalloc/build.rs
parent4da4970767ae8fc2e3b6d0c280312bb0f4efeed6 (diff)
downloadrust-eac0a8bc3070e45047fff57e7b024a059289a36d.tar.gz
rust-eac0a8bc3070e45047fff57e7b024a059289a36d.zip
bootstrap: Add directives to not double-link libs
Have all Cargo-built crates pass `--cfg cargobuild` and then add appropriate
`#[cfg]` definitions to all crates to avoid linking anything if this is passed.
This should help allow libstd to compile with both the makefiles and with Cargo.
Diffstat (limited to 'src/liballoc_jemalloc/build.rs')
-rw-r--r--src/liballoc_jemalloc/build.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs
index 18f0527425a..4bc752af48e 100644
--- a/src/liballoc_jemalloc/build.rs
+++ b/src/liballoc_jemalloc/build.rs
@@ -17,6 +17,8 @@ use std::process::Command;
 use build_helper::run;
 
 fn main() {
+    println!("cargo:rustc-cfg=cargobuild");
+
     let target = env::var("TARGET").unwrap();
     let host = env::var("HOST").unwrap();
     let build_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());