Skip to content

Commit

Permalink
pkg-config: Use the right link-line when generating pkg-config files
Browse files Browse the repository at this point in the history
We were always using the first package link line, leading to broken
pkg-config files.

For example in
https://gitlab.freedesktop.org/thiblahute/gst-plugins-rs/-/jobs/64909911,
we can see that static linking using that `.pc` file doesn't work as
it is not linking to `stdc++` in that specific case.
  • Loading branch information
thiblahute authored and lu-zero committed Oct 15, 2024
1 parent c12b670 commit 0ee354d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ pub fn cbuild(
let name = &cpkg.capi_config.library.name;
let (pkg_config_static_libs, static_libs) = if library_types.only_cdylib() {
(String::new(), String::new())
} else if let Some(libs) = exec.link_line.lock().unwrap().values().next() {
} else if let Some(libs) = exec.link_line.lock().unwrap().get(&cpkg.finger_print.id) {
(static_libraries(libs, &rustc_target), libs.to_string())
} else {
(String::new(), String::new())
Expand Down

0 comments on commit 0ee354d

Please sign in to comment.