Skip to content

Commit

Permalink
Remove #[link] attributes
Browse files Browse the repository at this point in the history
They cause the following warnings:
warning: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...",
                                               /*opt*/ cfg = "...")]`
 --> /tmp/coreaudio-sys/target/x86_64-apple-darwin/debug/build/coreaudio-sys-0d8fd082e359c2ec/out/coreaudio.rs:3:1
  |
3 | #[link = "/tmp/MacOSX10.14.sdk/System/Library/Frameworks/AudioToolbox"]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(ill_formed_attribute_input)] on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #57571 <rust-lang/rust#57571>

And they are actually redundant with the cargo:rustc-link-lib lines the
build script prints already.
  • Loading branch information
glandium committed Jul 26, 2019
1 parent 13a32d7 commit 62f6e22
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,34 +85,29 @@ fn build(frameworks_path: &str) {
use std::env;
use std::path::PathBuf;

let mut frameworks = vec![];
let mut headers = vec![];

#[cfg(feature = "audio_toolbox")]
{
println!("cargo:rustc-link-lib=framework=AudioToolbox");
frameworks.push("AudioToolbox");
headers.push("AudioToolbox.framework/Headers/AudioToolbox.h");
}

#[cfg(feature = "audio_unit")]
{
println!("cargo:rustc-link-lib=framework=AudioUnit");
frameworks.push("AudioUnit");
headers.push("AudioUnit.framework/Headers/AudioUnit.h");
}

#[cfg(feature = "core_audio")]
{
println!("cargo:rustc-link-lib=framework=CoreAudio");
frameworks.push("CoreAudio");
headers.push("CoreAudio.framework/Headers/CoreAudio.h");
}

#[cfg(feature = "open_al")]
{
println!("cargo:rustc-link-lib=framework=OpenAL");
frameworks.push("OpenAL");
headers.push("OpenAL.framework/Headers/al.h");
headers.push("OpenAL.framework/Headers/alc.h");
}
Expand All @@ -121,7 +116,6 @@ fn build(frameworks_path: &str) {
{
if std::env::var("TARGET").unwrap().contains("apple-darwin") {
println!("cargo:rustc-link-lib=framework=CoreMIDI");
frameworks.push("CoreMIDI");
headers.push("CoreMIDI.framework/Headers/CoreMIDI.h");
}
}
Expand All @@ -140,12 +134,6 @@ fn build(frameworks_path: &str) {
builder = builder.header(absolute_path);
}

// Link to all frameworks.
for relative_path in frameworks {
let link_instruction = format!("#[link = \"{}/{}\"]", frameworks_path, relative_path);
builder = builder.raw_line(link_instruction);
}

// Generate the bindings.
builder = builder
.trust_clang_mangling(false)
Expand Down

0 comments on commit 62f6e22

Please sign in to comment.