Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for the defunct StaticLibrary attribute #2647

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions crates/libs/bindgen/src/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,16 +575,6 @@ pub fn method_def_special_name(reader: &Reader, row: MethodDef) -> String {
}
}

pub fn method_def_static_lib(reader: &Reader, row: MethodDef) -> Option<String> {
reader.find_attribute(row, "StaticLibraryAttribute").and_then(|attribute| {
let args = reader.attribute_args(attribute);
if let Value::String(value) = &args[0].1 {
return Some(value.clone());
}
None
})
}

pub fn method_def_extern_abi(reader: &Reader, def: MethodDef) -> &'static str {
let impl_map = reader.method_def_impl_map(def).expect("ImplMap not found");
let flags = reader.impl_map_flags(impl_map);
Expand Down
8 changes: 0 additions & 8 deletions crates/libs/bindgen/src/rust/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,6 @@ fn gen_link(writer: &Writer, namespace: &str, signature: &Signature, cfg: &Cfg)
pub fn #ident(#(#params,)* #vararg) #return_type;
}
}
} else if let Some(library) = method_def_static_lib(writer.reader, signature.def) {
quote! {
#[link(name = #library, kind = "static")]
extern #abi {
#link_name
pub fn #ident(#(#params,)* #vararg) #return_type;
}
}
} else {
let symbol = if symbol != name { format!(" \"{symbol}\"") } else { String::new() };

Expand Down