[gnome-calculator] App: allow to disable application



commit edd54d153cf302c81a9bcc5591f7869412d4f376
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Apr 13 19:42:57 2022 -0500

    App: allow to disable application
    
    Use -Dapp=false in order to build GCalc and GCi by default
    also use -Dgci=false in order to disable GCi and just build
    GCalc.
    
    Use -Dgcalc=false to disable GCalc and GCi and just build
    application

 doc/meson.build   |  2 +-
 meson.build       | 23 ++++++++++++-----------
 meson_options.txt |  1 +
 tests/meson.build |  9 ++++++++-
 4 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/doc/meson.build b/doc/meson.build
index cf7215b4..752e6896 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -30,7 +30,7 @@ if get_option('gcalc')
                        )
 endif
 
-if not get_option('disable-ui') and get_option('gci')
+if not get_option('disable-ui') and get_option('gci')  and get_option('gcalc')
        gtkdoc_outdir = GCI_CAMEL_CASE_NAME+'-'+GCI_API_VERSION
        docsdir = join_paths (get_option ('datadir'), 'devhelp','books')
 
diff --git a/meson.build b/meson.build
index d68f994d..27ebdaef 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
 project('gnome-calculator', ['c', 'vala'],
   version: '42.0',
-  meson_version: '>= 0.57.0',
+  meson_version: '>= 0.56.0',
   license: 'GPLv3+',
 )
 
@@ -80,34 +80,35 @@ conf.set10('DEVELOPMENT_BUILD', get_option('development'))
 configure_file(output: 'config.h', configuration: conf)
 config_h_dir = include_directories('.')
 
-# Extra scripts
-if not get_option('disable-ui')
-gnome.post_install(
-  glib_compile_schemas: true,
-  gtk_update_icon_cache: true,
-)
-endif
 
 # Subdirs
+subdir('po')
 subdir('vapi')
 if get_option ('gcalc')
 subdir('gcalc')
 endif
 if not get_option ('disable-ui')
 gtk = dependency('gtk4', version: '>= 4.4.1')
-libadwaita = dependency('libadwaita-1', version: '>= 1.0.0')
 
-if get_option('gci')
+if get_option('gci') and get_option('gcalc')
 subdir('gci')
 endif
 
+if get_option('app')
+# Extra scripts
+gnome.post_install(
+  glib_compile_schemas: true,
+  gtk_update_icon_cache: true,
+)
+
+libadwaita = dependency('libadwaita-1', version: '>= 1.0.0')
 gtksourceview = dependency('gtksourceview-5', version: '>= 5.3.0')
 subdir('data')
 subdir('lib')
 subdir('src')
 subdir('search-provider')
 subdir('help')
-subdir('po')
+endif
 endif
 
 subdir('doc')
diff --git a/meson_options.txt b/meson_options.txt
index f9316d57..cdaa724e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,3 +6,4 @@ option('libpath', type: 'string', value : '', description : 'Used to add search
 option('development', type: 'boolean', value: false, description: 'If this is a development build')
 option('gcalc', type: 'boolean', value: true, description: 'Build GCalc library')
 option('gci', type: 'boolean', value: true, description: 'Build GCalc UI library')
+option('app', type: 'boolean', value: true, description: 'Build GNOME Calculator Application')
diff --git a/tests/meson.build b/tests/meson.build
index 82c0a7af..04a5d246 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,5 +1,7 @@
 if not get_option ('disable-ui')
 
+if get_option('app')
+
 # Common
 gnome_calculator_tests_deps = [
   gtk,
@@ -63,7 +65,9 @@ test_serializer = executable('test-serializer', test_serializer_sources,
 )
 test('Serializer test', test_serializer)
 
-if get_option('ui-tests')
+endif
+
+if get_option('ui-tests') and get_option('gci') and get_option('gcalc')
 gci_test_deps = [
        gee,
        gtk,
@@ -89,6 +93,7 @@ endif
 
 endif
 
+if get_option('gcalc')
 tests_deps = [
   gio,
   glib,
@@ -121,3 +126,5 @@ test_solve_basic = executable('gcalc-solve-basic', test_solve_basic_sources,
   link_with: [libgcalc, lib_mpfrg],
 )
 test('gcalc-solve-basic', test_solve_basic)
+
+endif


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