diff options
author | Thomas Haller <thaller@redhat.com> | 2018-05-30 15:16:01 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-05-31 15:59:38 +0200 |
commit | f445128af4255cc1c195530bd888f2024a4f71f3 (patch) | |
tree | ebb49b490d1f7003df8b757935a8ed92596777b0 /libnm-glib | |
parent | b8b6100c78a039c9ae02013860b1e1a93ac1783a (diff) |
build/meson: fix meson build for shared files
The files in shared/nm-utils are not compiled as one static library,
instead each subproject that needs (parts of) them, re-compiles the
files individually.
The major reason for that is, because we might have different compile
flags, depending on whether we build libnm-core or
libnm-util/libnm-glib. Actually, I think that is not really the case,
and maybe this should be refactored, to indeed build them all as a
static library first.
Anyway, libnm-util, libnm-glib, clients' common lib, they all need a
different set of shared files that they should compile. Refactor
"shared/meson.build" to account for that and handle it like autotools
does.
Another change is, that "shared_c_siphash_dep" no longer advertises
"include_directories: include_directories('c-siphash/src')". We don't
put c-siphash.h into the include search path. Users who need it, should
include it via "#include <c-siphash/src/c-siphash.h>". The only exception
is when building shared_n_acd library, which is not under our control.
Diffstat (limited to 'libnm-glib')
-rw-r--r-- | libnm-glib/meson.build | 26 | ||||
-rw-r--r-- | libnm-glib/tests/meson.build | 2 |
2 files changed, 16 insertions, 12 deletions
diff --git a/libnm-glib/meson.build b/libnm-glib/meson.build index aa1b7aaab..fabd88187 100644 --- a/libnm-glib/meson.build +++ b/libnm-glib/meson.build @@ -79,13 +79,6 @@ sources = files( glue = 'nm-vpn-plugin-glue.h' -sources += custom_target( - glue, - input: ifaces_vpn_plugin_xml, - output: glue, - command: [dbus_binding_tool, '--prefix=nm_vpn_plugin', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@'] -) - enum_types = 'nm-vpn-enum-types' libnm_glib_vpn_enum = gnome.mkenums( @@ -104,7 +97,18 @@ linker_script = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver') libnm_glib_vpn = shared_library( 'nm-glib-vpn', - sources: sources + libnm_glib_vpn_enum, + sources: files( + 'nm-vpn-plugin.c', + 'nm-vpn-plugin-ui-interface.c', + 'nm-vpn-plugin-utils.c', + ) + [ + custom_target( + glue, + input: ifaces_vpn_plugin_xml, + output: glue, + command: [dbus_binding_tool, '--prefix=nm_vpn_plugin', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@'], + ), + ] + libnm_glib_vpn_enum, version: libnm_glib_vpn_version, dependencies: deps, c_args: cflags, @@ -131,7 +135,7 @@ pkg.generate( variables: 'exec_prefix=${prefix}' ) -sources = shared_udev_utils + files( +libnm_glib_sources = shared_files_libnm_glib + files( 'nm-access-point.c', 'nm-active-connection.c', 'nm-client.c', @@ -194,7 +198,7 @@ linker_script = join_paths(meson.current_source_dir(), 'libnm-glib.ver') libnm_glib = shared_library( 'nm-glib', - sources: sources + libnm_glib_enum + [nm_secret_agent_glue], + sources: libnm_glib_sources + libnm_glib_enum + [nm_secret_agent_glue], version: libnm_glib_version, dependencies: deps, c_args: cflags, @@ -223,7 +227,7 @@ pkg.generate( ) if enable_introspection - gir_sources = sources + headers + libnm_glib_enum + gir_sources = libnm_glib_sources + headers + libnm_glib_enum deps = [ dbus_glib_dep, diff --git a/libnm-glib/tests/meson.build b/libnm-glib/tests/meson.build index fbabb9a9c..347790181 100644 --- a/libnm-glib/tests/meson.build +++ b/libnm-glib/tests/meson.build @@ -14,7 +14,7 @@ test_units = [ foreach test_unit: test_units exe = executable( test_unit, - [test_unit + '.c'] + shared_test_utils, + [test_unit + '.c'] + shared_nm_test_utils_impl_c, dependencies: deps, c_args: common_cflags + [ |