From: Lennart Poettering Date: Wed, 20 Dec 2017 11:51:14 +0000 (+0100) Subject: meson: resurrect API documentation target X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8d30fe45682bcbe4f9d1e739606e7a1a4692aad0;p=elogind.git meson: resurrect API documentation target We had this functionality back in Automake times, let's resurrect it. --- diff --git a/meson.build b/meson.build index e0e1f8478..bdda7561d 100644 --- a/meson.build +++ b/meson.build @@ -2869,6 +2869,14 @@ endif ############################################################ +meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh') +run_target( + 'check-api-docs', + depends : [man, libelogind, libudev], + command : [meson_check_api_docs_sh, libelogind.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 index 000000000..5bc808c1e --- /dev/null +++ b/tools/meson-check-api-docs.sh @@ -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