Skip to content

docs: Fix gtk-doc build when wayland is disabled

Ting-Wei Lan requested to merge wip/lantw/fix-gtkdoc-build-without-wayland into master

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.

The following error messages were found when building GTK+ with wayland disabled:

Building documentation for gdk4
ERROR:
Error in gtkdoc helper script:

ERROR: 'gtkdoc-scan' failed with status 1
Traceback (most recent call last):
  File "/home/lantw44/gnome/devinstall/bin/gtkdoc-scan", line 59, in <module>
    scan.Run(options)
  File "/home/lantw44/gnome/devinstall/share/gtk-doc/python/gtkdoc/scan.py", line 75, in Run
    ScanHeaders(dir, section_list, decl_list, get_types, options)
  File "/home/lantw44/gnome/devinstall/share/gtk-doc/python/gtkdoc/scan.py", line 130, in ScanHeaders
    for file in sorted(os.listdir(source_dir)):
FileNotFoundError: [Errno 2] No such file or directory: '/usr/home/lantw44/gnome/build/gtk+/gdk/wayland'

Merge request reports