Skip to content

Commit 0ee354d

Browse files
thiblahutelu-zero
authored andcommitted
pkg-config: Use the right link-line when generating pkg-config files
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.
1 parent c12b670 commit 0ee354d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ pub fn cbuild(
11771177
let name = &cpkg.capi_config.library.name;
11781178
let (pkg_config_static_libs, static_libs) = if library_types.only_cdylib() {
11791179
(String::new(), String::new())
1180-
} else if let Some(libs) = exec.link_line.lock().unwrap().values().next() {
1180+
} else if let Some(libs) = exec.link_line.lock().unwrap().get(&cpkg.finger_print.id) {
11811181
(static_libraries(libs, &rustc_target), libs.to_string())
11821182
} else {
11831183
(String::new(), String::new())

0 commit comments

Comments
 (0)