[libgweather/ebassi/issue-170] build: Disable documentation when cross-compiling




commit 99e496010eecadfb6a6931288dcc5149b37bbdd9
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Aug 22 18:47:50 2022 +0100

    build: Disable documentation when cross-compiling
    
    The API reference depends on the introspection data, and in order to
    build that, we have to ensure that we are not cross-compiling.
    
    Fixes: #170

 doc/meson.build         | 2 +-
 libgweather/meson.build | 3 ---
 meson.build             | 6 +++++-
 3 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/doc/meson.build b/doc/meson.build
index aca24827..de2a2b5d 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,4 +1,4 @@
-if get_option('gtk_doc') and get_option('introspection')
+if build_docs
   dependency('gi-docgen', version: '>= 2021.6',
     fallback: ['gi-docgen', 'dummy_dep'],
   )
diff --git a/libgweather/meson.build b/libgweather/meson.build
index 22738e67..d076c5fe 100644
--- a/libgweather/meson.build
+++ b/libgweather/meson.build
@@ -200,9 +200,6 @@ lib_libgweather = library('gweather-4',
   install: true,
 )
 
-g_ir_scanner = find_program('g-ir-scanner', required: get_option('introspection'))
-build_gir = get_option('introspection') and g_ir_scanner.found() and not meson.is_cross_build()
-
 enable_vala = get_option('enable_vala')
 vapigen = find_program('vapigen', required: enable_vala == 'true')
 if enable_vala == 'auto' or enable_vala == 'true'
diff --git a/meson.build b/meson.build
index 27fcdc7d..8d56d696 100644
--- a/meson.build
+++ b/meson.build
@@ -50,6 +50,10 @@ pylint_flags = [
 py = import('python').find_installation('python3', modules: ['gi'])
 gen_locations_variant = find_program('build-aux/meson/gen_locations_variant.py')
 
+g_ir_scanner = find_program('g-ir-scanner', required: get_option('introspection'))
+build_gir = get_option('introspection') and g_ir_scanner.found() and not meson.is_cross_build()
+build_docs = get_option('gtk_doc') and build_gir
+
 subdir('data')
 subdir('schemas')
 subdir('libgweather')
@@ -74,7 +78,7 @@ summary({
     'Use libsoup-2': get_option('soup2'),
     'Introspection': build_gir,
     'Generate VAPI': build_vapi,
-    'API reference': get_option('gtk_doc'),
+    'API reference': build_docs,
   },
   section: 'Build',
   bool_yn: true,


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