18.03.2024 10:35, Marc-André Lureau wrote: ..
dbus-display1 is also used with static linking for the unit test.It looks like the simplest is to let the actual target decide how it is built, even if it is compiled multiple time then: - dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) - dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, sources: dbus_display1[0]) + dbus_display1_dep = declare_dependency(sources: dbus_display1, dependencies: gio) This makes commit 186acfbaf7 ("tests/qtest: Depend on dbus_display1_dep") no longer relevant, as dbus-display1.c will be recompiled.
I definitely prefer this approach.
Alternatively, we could always build with pic: true (or pic: enable_modules), but that's not ideal either.
Here, we as well might enable pic unconditionally for just everything. But this is not for this change, and it needs to be discussed first. So far the consensus was to only enable pic for shared objects. Also, with --enable-static it has other implications. /mjt
