meson: Make gtkdoc-check work with older gtk-doc
authorOlivier Crête <olivier.crete@collabora.com>
Fri, 22 May 2020 14:36:52 +0000 (10:36 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Fri, 22 May 2020 18:36:08 +0000 (14:36 -0400)
Older gtkdoc versions expect to find a Makefile, so generate
a fake one with the information it wants.

NEWS
docs/reference/libnice/meson.build

diff --git a/NEWS b/NEWS
index e7f60e6..45be352 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+libnice 0.1.17 (2020-05-21)
+===========================
+Add API to retrieve the underlying BSD sockets
+
+
 libnice 0.1.16 (2019-05-09)
 ===========================
 Add API to make it easier to implement ICE trickle
index 9e1a717..43021cd 100644 (file)
@@ -24,12 +24,25 @@ ignore_headers = [
   'win32_common.h',
 ]
 
+if dependency('gtk-doc', version: '<1.30', required: false).found()
+  prog_python = import('python').find_installation('python3')
+  fake_makefile = custom_target ('libnice-docs-test-Makefile',
+                                 output: 'Makefile',
+                                 command: [
+                                   prog_python, '-c',
+                                   'with open("@OUTPUT@","w") as f: f.writelines(["""DOC_MODULE=libnice\nDOC_MAIN_SGML_FILE=libnice-docs.sgml\n"""])'
+                                   ])
+else
+  fake_makefile = []
+endif
+
 gnome.gtkdoc('libnice',
+             content_files: [fake_makefile],
              main_xml: 'libnice-docs.xml',
              namespace: 'nice',
              mode: 'none',
              src_dir: [agent_include, stun_include],
-             dependencies: libnice_dep,
+             dependencies: [libnice_dep, fake_makefile],
              scan_args: [
                '--rebuild-types',
                #'--deprecated-guards=G_DISABLE_DEPRECATED',