build: meson: fix dependency to gdbus generated headers
libnm has a dependency on 'libnmdbus_dep', which contains 'link_with: libnmdbus'. This however only enforces that libnm is linked after the libnmdbus static library is built; it doesn't give any guarantees about the compilation phase. We need to make libnm compilation depend on the generated header files. The output of 'gnome.gdbus_codegen' is an array with the header file in the second position; use it to add a proper dependency. Unfortunately this works only with meson >= 0.46. In the future libnm will no longer use gdbus generated code and this dependency will not be needed anymore. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/286
This commit is contained in:
@@ -56,6 +56,7 @@ ifaces = [
|
||||
ifaces_xmls = []
|
||||
sources = []
|
||||
introspection_files = []
|
||||
headers = []
|
||||
|
||||
# FIXME?: DBUS_INTERFACE_DOCS/docbook files are generated in
|
||||
# "meson.current_build_dir()" instead of "meson.source_root()/docs/api"
|
||||
@@ -85,6 +86,7 @@ foreach iface: ifaces
|
||||
# older versions
|
||||
if meson.version().version_compare('>= 0.46.0')
|
||||
introspection_files += [ [res[2], dbus_iface_xml_path] ]
|
||||
headers += res[1]
|
||||
endif
|
||||
|
||||
endforeach
|
||||
@@ -102,9 +104,7 @@ libnmdbus = static_library(
|
||||
)
|
||||
|
||||
libnmdbus_dep = declare_dependency(
|
||||
# FIXME: only headers should be added here to resolve dependencies on
|
||||
# libNetworkManagerBase and libNetworkManager
|
||||
#sources: sources,
|
||||
sources: headers,
|
||||
include_directories: include_directories('.'),
|
||||
link_with: libnmdbus,
|
||||
)
|
||||
|
Reference in New Issue
Block a user