diff --git a/core-foundation-sys/Cargo.toml b/core-foundation-sys/Cargo.toml index e60e513..6bbbc6a 100644 --- a/core-foundation-sys/Cargo.toml +++ b/core-foundation-sys/Cargo.toml @@ -6,7 +6,6 @@ repository = "https://github.com/servo/core-foundation-rs" version = "0.8.3" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" -build = "build.rs" [dependencies] diff --git a/core-foundation-sys/build.rs b/core-foundation-sys/build.rs deleted file mode 100644 index 1f03b06..0000000 --- a/core-foundation-sys/build.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - if std::env::var("TARGET").unwrap().contains("-apple") { - println!("cargo:rustc-link-lib=framework=CoreFoundation"); - } -} diff --git a/core-foundation-sys/src/lib.rs b/core-foundation-sys/src/lib.rs index f9a1884..48c0887 100644 --- a/core-foundation-sys/src/lib.rs +++ b/core-foundation-sys/src/lib.rs @@ -10,6 +10,16 @@ #![cfg_attr(all(feature="mac_os_10_7_support", feature="mac_os_10_8_features"), feature(linkage))] // back-compat requires weak linkage +// Link to CoreFoundation on any Apple device. +// +// We don't use `target_vendor` since that is going to be deprecated: +// https://github.com/rust-lang/lang-team/issues/102 +#[cfg_attr( + any(target_os = "macos", target_os = "ios", target_os = "tvos"), + link(name = "CoreFoundation", kind = "framework") +)] +extern "C" {} + pub mod array; pub mod attributed_string; pub mod base;