From eac0a8bc3070e45047fff57e7b024a059289a36d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 21 Jan 2016 15:36:25 -0800 Subject: 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. --- src/libstd/sys/unix/os.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstd/sys/unix') diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 9def3adc303..b6a0bd84409 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -339,7 +339,6 @@ pub fn args() -> Args { pub fn args() -> Args { use mem; - #[link(name = "objc")] extern { fn sel_registerName(name: *const libc::c_uchar) -> Sel; fn objc_msgSend(obj: NsId, sel: Sel, ...) -> NsId; @@ -347,6 +346,8 @@ pub fn args() -> Args { } #[link(name = "Foundation", kind = "framework")] + #[link(name = "objc")] + #[cfg(not(cargobuild))] extern {} type Sel = *const libc::c_void; -- cgit 1.4.1-3-g733a5