[gnome-online-accounts] examples can be compiled even if !enable_goabackend
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] examples can be compiled even if !enable_goabackend
- Date: Sun, 10 Jul 2022 21:39:41 +0000 (UTC)
commit 67c4eed60a5a7defead2f3d001ebe6d8b2f8305e
Author: Paolo Bonzini <pbonzini redhat com>
Date: Thu May 19 08:58:53 2022 +0200
examples can be compiled even if !enable_goabackend
This also means searching for librest even if !enable_goabackend. However,
in that case the build can proceed without the library and only the example
that uses it is removed.
meson.build | 11 ++++++-----
src/examples/meson.build | 5 +++--
src/meson.build | 3 ++-
3 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/meson.build b/meson.build
index dddfc4a3..f2171414 100644
--- a/meson.build
+++ b/meson.build
@@ -102,13 +102,14 @@ if enable_goabackend
libsecret_dep = dependency('libsecret-1')
libsoup_dep = dependency('libsoup-3.0', version: '>= 3.0', fallback: ['libsoup'])
libxml_dep = dependency('libxml-2.0')
- rest_dep = dependency('rest-1.0',
- version: '>= 0.9.0',
- fallback: ['librest', 'librest_dep'],
- default_options: ['soup2=false', 'examples=false', 'tests=false', 'gtk_doc=false'],
- )
webkit_gtk_dep = dependency('webkit2gtk-4.1', version: '>= 2.33.1')
endif
+rest_dep = dependency('rest-1.0',
+ version: '>= 0.9.0',
+ fallback: ['librest', 'librest_dep'],
+ required: enable_goabackend,
+ default_options: ['soup2=false', 'examples=false', 'tests=false', 'gtk_doc=false'],
+)
config_h.set('GOA_BACKEND_ENABLED', enable_goabackend)
enable_inspector = get_option('inspector')
diff --git a/src/examples/meson.build b/src/examples/meson.build
index 3c2d1818..cef3062e 100644
--- a/src/examples/meson.build
+++ b/src/examples/meson.build
@@ -1,9 +1,10 @@
programs = [
# program name, deps
['list-accounts', libgoa_dep],
- ['lastfm-shout', [libgoa_dep, rest_dep]]
]
-
+if rest_dep.found()
+ ['lastfm-shout', [libgoa_dep, rest_dep]]
+endif
if enable_goabackend
programs += [
['introspect-providers', libgoa_backend_dep],
diff --git a/src/meson.build b/src/meson.build
index d9a5d656..a87e282e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -11,5 +11,6 @@ if enable_goabackend
subdir('goabackend')
subdir('daemon')
- subdir('examples')
endif
+
+subdir('examples')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]