[gnome-desktop/ebassi/update-for-gtk4] Enable optional building of GTK4 libraries



commit 535ebd38169cd7d37142ac6de8ec10bb46acc5fe
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Nov 9 15:46:41 2021 +0000

    Enable optional building of GTK4 libraries
    
    We want to allow building libgnome-desktop without the GUI libraries.

 libgnome-desktop/meson.build | 6 ++++--
 meson.build                  | 2 +-
 meson_options.txt            | 4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/libgnome-desktop/meson.build b/libgnome-desktop/meson.build
index 446c66fe..44bc4613 100644
--- a/libgnome-desktop/meson.build
+++ b/libgnome-desktop/meson.build
@@ -156,8 +156,10 @@ libgnome_desktop_base_dep = declare_dependency(
   ],
 )
 
-subdir('gnome-bg')
-subdir('gnome-rr')
+if gtk4_dep.found()
+  subdir('gnome-bg')
+  subdir('gnome-rr')
+endif
 
 ### Legacy ###
 introspection_sources = [
diff --git a/meson.build b/meson.build
index a54d3fd0..68613093 100644
--- a/meson.build
+++ b/meson.build
@@ -49,7 +49,7 @@ versiondir = datadir / 'gnome'
 
 gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req)
 gtk3_dep = dependency('gtk+-3.0', version: gtk3_req)
-gtk4_dep = dependency('gtk4', version: gtk4_req)
+gtk4_dep = dependency('gtk4', version: gtk4_req, required: get_option('build_gtk4'))
 glib_dep = dependency('glib-2.0', version: glib_req)
 gio_dep = dependency('gio-2.0', version: glib_req)
 gio_unix_dep = dependency('gio-unix-2.0', version: glib_req)
diff --git a/meson_options.txt b/meson_options.txt
index c0fea3f8..9fe2d7bd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -32,3 +32,7 @@ option('gtk_doc',
 option('installed_tests',
   type: 'boolean', value: false, description: 'Enable installed tests'
 )
+
+option('build_gtk4',
+  type: 'boolean', value: true, description: 'Enable GTK4 libraries'
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]