From d1475d0d2c2abadee8348cab67a9b6a8fd0a909a Mon Sep 17 00:00:00 2001 From: Fenrir Date: Sun, 21 Jan 2018 19:00:05 -0700 Subject: [PATCH] Ensure that the sysroot uses its own libc --- ctr-std/Cargo.toml | 5 +---- ctru-sys/Cargo.toml | 3 +++ ctru-sys/src/lib.rs | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ctr-std/Cargo.toml b/ctr-std/Cargo.toml index be1717f..e41e2eb 100644 --- a/ctr-std/Cargo.toml +++ b/ctr-std/Cargo.toml @@ -9,12 +9,9 @@ git = "https://github.com/rust-lang-nursery/compiler-builtins" [dependencies.alloc_system] git = "https://github.com/rust3ds/alloc_system3ds" -[dependencies.libc] -version = "0.2" -default-features = false - [dependencies.ctru-sys] path = "../ctru-sys" +default-features = false features = ["stdbuild"] [features] diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 7dd0b02..4d1d0cf 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -7,8 +7,11 @@ license = "https://en.wikipedia.org/wiki/Zlib_License" [dependencies.libc] version = "0.2" default-features = false +optional = true [features] +default = ["libc"] + # This is a dummy feature that only exists to work around a Xargo issue. # User code should not enable it. stdbuild = [] diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 053d86d..4b40a5c 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -7,6 +7,8 @@ #![no_std] +#![cfg_attr(feature = "stdbuild", feature(libc))] + extern crate libc; include!("bindings.rs");