summaryrefslogtreecommitdiff
path: root/examples/C
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-11-25 11:39:06 +0100
committerThomas Haller <thaller@redhat.com>2017-12-13 15:48:50 +0100
commit03637ad8b5d21fcc12a536a25caf46445aabde73 (patch)
tree3330fed2a9ad0f45c0c993a8aac6d3dee42ed101 /examples/C
parente96fabfc186510808cee1bf6aaaa28f460f1cea5 (diff)
downloadNetworkManager-03637ad8b5d21fcc12a536a25caf46445aabde73.tar.gz
build: add initial support for meson build system
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. [thaller@redhat.com: rebased patch and adjusted for iwd support] https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00022.html
Diffstat (limited to 'examples/C')
-rw-r--r--examples/C/glib/meson.build27
-rw-r--r--examples/C/qt/meson.build47
2 files changed, 74 insertions, 0 deletions
diff --git a/examples/C/glib/meson.build b/examples/C/glib/meson.build
new file mode 100644
index 0000000000..f6412643e5
--- /dev/null
+++ b/examples/C/glib/meson.build
@@ -0,0 +1,27 @@
+examples = [
+ ['add-connection-gdbus', [uuid_dep], [libnm_core_enums_h, libnm_enums_h]],
+ ['add-connection-libnm', [libnm_dep], []],
+ ['get-active-connections-gdbus', [], [libnm_core_enums_h, libnm_enums_h]],
+ ['get-ap-info-libnm', [libnm_dep], []],
+ ['list-connections-gdbus', [], []],
+ ['list-connections-libnm', [libnm_dep], []],
+ ['monitor-nm-running-gdbus', [], []],
+ ['monitor-nm-state-gdbus', [], []]
+]
+
+incs = [
+ top_inc,
+ shared_inc,
+ libnm_core_inc,
+ libnm_inc
+]
+
+foreach example: examples
+ executable(
+ example[0],
+ [example[0] + '.c'] + example[2],
+ include_directories: incs,
+ dependencies: [glib_dep] + example[1],
+ c_args: '-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE'
+ )
+endforeach
diff --git a/examples/C/qt/meson.build b/examples/C/qt/meson.build
new file mode 100644
index 0000000000..d92205b1bd
--- /dev/null
+++ b/examples/C/qt/meson.build
@@ -0,0 +1,47 @@
+examples = [
+ ['add-connection-wired', []],
+ ['list-connections', []],
+ ['change-ipv4-addresses', []]
+]
+
+incs = [
+ top_inc,
+ libnm_core_inc
+]
+
+qt_core_dep = dependency('QtCore', version: '>= 4')
+
+deps = [
+ dbus_dep,
+ dbus_glib_dep,
+ qt_core_dep,
+ dependency('QtDBus'),
+ dependency('QtNetwork')
+]
+
+moc = find_program('moc-qt4', required: false)
+if not moc.found()
+ moc = qt_core_dep.get_pkgconfig_variable('moc_location')
+endif
+
+example = 'monitor-nm-running'
+output = example + '.moc'
+
+example_moc = custom_target(
+ output,
+ input: example + '.cpp',
+ output: output,
+ command: [moc, '-i', '@INPUT@', '-o', '@OUTPUT@']
+)
+
+examples += [[example, [example_moc]]]
+
+foreach example: examples
+ executable(
+ example[0],
+ example[0] + '.cpp',
+ include_directories: incs,
+ dependencies: deps,
+ link_depends: example[1]
+ )
+endforeach