]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: resurrect API documentation target
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Dec 2017 11:51:14 +0000 (12:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 5 Jan 2018 12:58:33 +0000 (13:58 +0100)
We had this functionality back in Automake times, let's resurrect it.

meson.build
tools/meson-check-api-docs.sh [new file with mode: 0644]

index f95feee99de179e23f88680d5b8cfd945c0974c2..924274de630af0d1c3b28dc24d2987efdedb6a5f 100644 (file)
@@ -2556,6 +2556,14 @@ endif
 
 ############################################################
 
+meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh')
+run_target(
+        'check-api-docs',
+        depends : [man, libsystemd, libudev],
+        command : [meson_check_api_docs_sh, libsystemd.full_path(), libudev.full_path()])
+
+############################################################
+
 status = [
         '@0@ @1@'.format(meson.project_name(), meson.project_version()),
 
diff --git a/tools/meson-check-api-docs.sh b/tools/meson-check-api-docs.sh
new file mode 100644 (file)
index 0000000..5bc808c
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -eu
+
+for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | sort -u` ; do
+        if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then
+                echo "✓ Symbol $symbol() is documented."
+        else
+                printf "  \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m\n"
+        fi
+done