[libsoup/wip/docs-updates: 1/2] build: Handle docs being built without introspection




commit ffb3ca37d88471d1e153ae0e602fe678380c2ab9
Author: Patrick Griffis <pgriffis igalia com>
Date:   Thu Apr 14 13:08:29 2022 -0500

    build: Handle docs being built without introspection

 docs/reference/meson.build | 10 +++++++++-
 meson.build                |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 32f6f748..92710260 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -16,7 +16,15 @@ gidocgen_dep = dependency('gi-docgen', version: '>= 2021.1',
   required: get_option('docs')
 )
 
-if gidocgen_dep.found()
+have_docs = gidocgen_dep.found()
+if not enable_introspection and get_option('docs').auto()
+  have_docs = false
+  warning('Documentation will not be built as introspection was disabled')
+elif not enable_introspection and get_option('docs').enabled()
+  error('Documentation cannot be built without introspection being enabled')
+endif
+
+if have_docs
   libsoup_toml = configure_file(
     input: 'libsoup.toml.in',
     output: 'libsoup.toml',
diff --git a/meson.build b/meson.build
index d878d2e9..43531948 100644
--- a/meson.build
+++ b/meson.build
@@ -402,7 +402,7 @@ subdir('examples')
 subdir('fuzzing')
 if get_option('tests')
   subdir('tests')
- endif
+endif
 
 srcdir = include_directories('libsoup')
 subdir('docs/reference')
@@ -422,7 +422,7 @@ summary({
     'Translations' : xgettext.found(),
     'GIR' : enable_introspection,
     'VAPI' : enable_vapi,
-    'Documentation' : gidocgen_dep.found(),
+    'Documentation' : have_docs,
   },
   section : 'Features'
 )


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