]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
build: Link subprojects statically if built as a subproject
authorSimon McVittie <smcv@collabora.com>
Fri, 28 Feb 2025 12:31:01 +0000 (12:31 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 28 Feb 2025 13:03:07 +0000 (13:03 +0000)
If we're building a dependency as a fallback subproject, we don't want
to be responsible for installing it as a shared library. Anyone wanting
shared libraries should install the dependencies separately.

Ideally we'd do this with MSVC too, but that doesn't currently link
successfully (dbus#549).

Signed-off-by: Simon McVittie <smcv@collabora.com>
meson.build

index f46b551c25c2e7cca7ff8d292881483dfd2c052a..19d842ce07a5398ac10a4e3ccaacaa85c34116d2 100644 (file)
@@ -368,6 +368,12 @@ fallback_subproject_options = [
     'werror=false',
 ]
 
+if cc.get_id() != 'msvc'
+    # TODO: Ideally we'd have default_library=static with MSVC too,
+    # but see https://gitlab.freedesktop.org/dbus/dbus/-/issues/549
+    fallback_subproject_options += ['default_library=static']
+endif
+
 # Controls whether message bus daemon is built. Tests which depend on
 # a running dbus-daemon will be disabled if message_bus is not set.
 message_bus = get_option('message_bus')