docs: Fix gtk-doc build when wayland is disabled
authorTing-Wei Lan <lantw@src.gnome.org>
Fri, 15 Jun 2018 15:51:15 +0000 (23:51 +0800)
committerTing-Wei Lan <lantw@src.gnome.org>
Fri, 15 Jun 2018 15:51:15 +0000 (23:51 +0800)
Unconditionally putting 'gdkwayland_inc' in src_dir argument of gtkdoc
call tells gtkdoc-scan to scan source files in a non-existent build
directory, gdk/wayland. To avoid causing build failure when a specific
backend is disabled, we should include directories conditionally.

docs/reference/gdk/meson.build

index 72bcfc55cf63fc653f546841912e8d4ac4f5430e..57f93a963739d250dc4e056cdd6310be4cea2d75 100644 (file)
@@ -87,16 +87,22 @@ images = [
   'images/zoom_out_cursor.png',
 ]
 
+src_dir = [ gdkinc ]
+
+if x11_enabled
+  src_dir += [ gdkx11_inc ]
+endif
+
+if wayland_enabled
+  src_dir += [ gdkwayland_inc ]
+endif
+
 configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
 
 gnome.gtkdoc('gdk4',
              mode: 'none',
              main_xml: 'gdk4-docs.xml',
-             src_dir: [
-               gdkinc,
-               gdkx11_inc,
-               gdkwayland_inc,
-            ],
+             src_dir: src_dir,
              dependencies: libgtk_dep,
              gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk4.types'),
              scan_args: [