aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2023-07-19 14:05:54 +0200
committerDan Williams <dan@ioncontrol.co>2025-05-22 08:20:19 -0500
commitc04f178ddaf7951ffafd59a61ce0ebf238af90bb (patch)
treedc1723f45398b2a55188b1f6b639bfdc46c7dc82
parent9cb5a2d09086fc8a1f0704436302e431947b44c0 (diff)
build: Allow to use libqmi as subproject
This makes it simpler to build ModemManager git Signed-off-by: Guido Günther <agx@sigxcpu.org>
-rw-r--r--.gitignore1
-rw-r--r--meson.build20
-rw-r--r--subprojects/libqmi.wrap5
3 files changed, 24 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index ecb82c0e..b457b25c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ tags
/.vscode
/cscope.out
subprojects/libmbim
+subprojects/libqmi
diff --git a/meson.build b/meson.build
index 72d2ab22..fd094f7c 100644
--- a/meson.build
+++ b/meson.build
@@ -275,7 +275,18 @@ config_h.set('WITH_MBIM', enable_mbim)
# QMI support (enabled by default)
enable_qmi = get_option('qmi')
if enable_qmi
- qmi_glib_dep = dependency('qmi-glib', version: '>= 1.36.0')
+ qmi_glib_dep = dependency('qmi-glib', version: '>= 1.36.0',
+ required: not get_option('subproject-fallback'))
+
+ if not qmi_glib_dep.found() and get_option('subproject-fallback')
+ qmi_glib_proj = subproject('libqmi',
+ default_options: ['man=false',
+ 'mbim_qmux=false',
+ 'introspection=false',
+ 'bash_completion=false',
+ ])
+ qmi_glib_dep = qmi_glib_proj.get_variable('libqmi_glib_dep')
+ endif
endif
config_h.set('WITH_QMI', enable_qmi)
@@ -283,7 +294,12 @@ config_h.set('WITH_QMI', enable_qmi)
enable_qrtr = get_option('qrtr')
if enable_qrtr
assert(enable_qmi, 'QRTR support requires QMI enabled')
- assert(qmi_glib_dep.get_pkgconfig_variable('qmi_qrtr_supported').to_int().is_odd(), 'Couldn\'t find QRTR support in qmi-glib.')
+ if qmi_glib_dep.type_name() == 'internal'
+ qmi_qrtr_supported = qmi_glib_proj.get_variable('enable_qrtr')
+ else
+ qmi_qrtr_supported = qmi_glib_dep.get_pkgconfig_variable('qmi_qrtr_supported')
+ endif
+ assert(qmi_qrtr_supported.to_int().is_odd(), 'Couldn\'t find QRTR support in qmi-glib.')
qrtr_glib_dep = dependency('qrtr-glib', version: '>= 1.0.0')
endif
config_h.set('WITH_QRTR', enable_qrtr)
diff --git a/subprojects/libqmi.wrap b/subprojects/libqmi.wrap
new file mode 100644
index 00000000..2511ce47
--- /dev/null
+++ b/subprojects/libqmi.wrap
@@ -0,0 +1,5 @@
+[wrap-git]
+directory=libqmi
+url=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
+revision=main
+