[gedit] build: simplify handling of gtk_doc option



commit 83e3de9c71b0ba0af752709287ac76687f1d7f8f
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      | 12 ++++--------
 2 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/meson.build b/meson.build
index bc88ecaed..e9d1c1561 100644
--- a/meson.build
+++ b/meson.build
@@ -68,7 +68,6 @@ x11_dep = dependency('x11', required: false)
 
 introspection_dep = dependency('gobject-introspection-1.0', required: false)
 vapigen_dep = dependency('vapigen', version: '>= 0.25.1', required: false)
-gtk_doc_dep = dependency('gtk-doc', required: false)
 
 python3 = python.find_installation('python3')
 
@@ -124,11 +123,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',
@@ -149,7 +143,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')
@@ -167,7 +163,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]