sdl2-sys: Avoid to add unwanted system folder in library research paths#1208
sdl2-sys: Avoid to add unwanted system folder in library research paths#1208rofferom wants to merge 1 commit intoRust-SDL2:masterfrom
Conversation
Default pkg-config-rs behavior is to add default system library paths (ex: -L/usr/lib/x86_64-linux-gnu). This is because PKG_CONFIG_ALLOW_SYSTEM_LIBS is set by pkg-config-rs by default. print_system_libs(false) disable this behavior. More details in evdev-rs project: ndesh26/evdev-rs#85
40ccddf to
31b08a4
Compare
|
I'm sorry it seems i didn't have the notification a few months ago. Isn't partially the point of pkg-config to use system libs and find where they are? If you disable that, won't pkg config fail to find the sdl2 paths? I'm having a hard time understanding what would happen to the average user |
|
Actually, gcc has a default research path for system libraries. For the average user, my patch should have no impact at all. On my computer, I get correct flags with : Instead, the default behavior of Rust pkg-config crate is A redundant I think there is no impact for your project, but I would understand if you don't agree with that. |
I don't think is this true for static linking, only for dynamic linking. I know the pkg-config feature was introduced partially due to static linking. Could you please test that it still works with your PR? |
This is "true", but we are not using gcc. I made some tests to force a sample C program to statically link with SDL2, there is no issue when system. But when I'm forcing a static link when using rust-sdl2, I have a link issue. So my initial statement is false in the context of this PR :)
You are right rust-lang/pkg-config-rs#11, there are many complains link mine, but what you said is explained many times. There are also many references of projects that are doing the same kind of change than this PR. Maybe the correct update of my patch would be - .print_system_libs(false)
+ .print_system_libs(statik) |
Default pkg-config-rs behavior is to add default system library paths (ex:
-L/usr/lib/x86_64-linux-gnu).
This is because PKG_CONFIG_ALLOW_SYSTEM_LIBS is set by pkg-config-rs by
default. print_system_libs(false) disable this behavior.
More details in evdev-rs project:
ndesh26/evdev-rs#85