[gedit/zbrown/deteplification-src: 84/633] build: simplify handling of gtk_doc option




commit c0eb64ac45b770c498b7172d572302d9cbacb421
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Dec 5 12:52:31 2019 +0100

    build: simplify handling of gtk_doc option
    
    It's not a good practice to have automatic build options: a build option
    that is enabled or disabled depending on whether the dependency is
    installed or not. It makes the build less predictable.
    
    In this case when enabling the gtk_doc option, it was actually disabled
    if gtk-doc was not installed. It's better in that case to show an error.
    
    And now if the gtk_doc option is enabled, and gtk-doc is not installed,
    the error shown is:
    ERROR: Program(s) ['gtkdoc-scan'] not found or not executable
    
    I think the error message is clear enough, no need to add a dependency()
    call. It also simplifies the build instructions.

 docs/meson.build |  3 ---
 meson.build      | 13 ++++---------
 2 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/meson.build b/meson.build
index a5d467754..7667092bb 100644
--- a/meson.build
+++ b/meson.build
@@ -55,7 +55,6 @@ gspell_req = '>= 0.2.5'
 pygobject_req = '>= 3.0.0'
 introspection_req = '>= 0.9.3'
 vala_req = '>= 0.25.1'
-gtk_doc_req = '>= 1.0'
 
 glib_dep = dependency('glib-2.0', version: glib_req)
 gobject_dep = dependency('gobject-2.0', version: glib_req)
@@ -76,7 +75,6 @@ x11_dep = dependency('x11', required: false)
 
 introspection_dep = dependency('gobject-introspection-1.0', version: introspection_req, required: false)
 vapigen_dep = dependency('vapigen', version: vala_req, required: false)
-gtk_doc_dep = dependency('gtk-doc', version: gtk_doc_req, required: false)
 
 python3 = python.find_installation('python3')
 
@@ -143,11 +141,6 @@ if generate_vapi and not vapigen_dep.found()
   generate_vapi = false
 endif
 
-build_gtk_doc = get_option('gtk_doc')
-if build_gtk_doc and not gtk_doc_dep.found()
-  build_gtk_doc = false
-endif
-
 active_plugins = [
   'docinfo',
   'modelines',
@@ -168,7 +161,9 @@ if build_plugins == true
   subdir('plugins')
 endif
 
-subdir('docs')
+if get_option('gtk_doc')
+  subdir('docs/reference')
+endif
 
 if get_option('user_documentation')
   subdir('help')
@@ -186,7 +181,7 @@ summary = [
   '------',
   'gedit @0@ (@1@)'.format(meson.project_version(), api_version),
   '',
-  '       API docs: @0@'.format(build_gtk_doc),
+  '       API docs: @0@'.format(get_option('gtk_doc')),
   '      User docs: @0@'.format(get_option('user_documentation')),
   '  Introspection: @0@'.format(generate_gir),
   '        Plugins: @0@'.format(build_plugins),


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