Skip to content

[th/build-meson-cleanup] cleanup meson build setup

Thomas Haller requested to merge th/build-meson-cleanup into master

with meson we used to have many many "helper" variables and dependencies. I think that makes compilation more confusing.

For shared_libraries, a dependency is fine -- in particular for libnm_dep, because we also have a dependency on creating the glib-mkenum files in src/libnm-core-public and src/libnm-client-public. Also, with shared libraries there is not the potential problem that we include code twice (unlike with static libs).

With static libraries, we should be very careful at which stage we link with the static library: and the answer is always "at the very end", when we build the final executable, shared_library or shared_module. Note that for certain shared_modules (like libnm-device-plugin-*.so), we don't link with several of the static libraries, because they must be provided by NetworkManager binary (which dlopens these shared-modules). So with static libraries, we don't need to declare a dependency, it makes it actually more confusing.

This is not yet done for src/core and clients/, but if you look at the other build targets, I think it is now very clearly visible which dependencies they have (few), which include paths they have (few), which c-flags they have (mostly none) and which static libraries they link with (many, because we have many static libs and don't obfuscate their use with nested dependencies).

In particular, a static library should not link with any other static library.


also move dispatcher/ to src/nm-dispatcher/.

Merge request reports