From 0a5dc16976cdb464ac7758d2ea9613429382d9d1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 8 Aug 2018 11:18:20 +1000 Subject: [PATCH] doc: use configure_file()'s @PLAINNAME@ instead of calling install Instead of calling out to install on every ninja call, use @PLAINNAME@ as substitution for just copying the file over. This gets around the "no directory allowed in output file" limitation. Signed-off-by: Peter Hutterer --- doc/api/meson.build | 25 ++++++++++++++++++------- doc/user/meson.build | 29 ++++++++++++++++++----------- meson.build | 2 +- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/doc/api/meson.build b/doc/api/meson.build index 13e76593..1c428623 100644 --- a/doc/api/meson.build +++ b/doc/api/meson.build @@ -46,11 +46,22 @@ src_doxygen = files( 'style/libinputdoxygen.css', ) -doxyfiles = custom_target('doxyfiles', - input : src_doxygen, - output : 'doxyfiles', - command : [prg_install, '-t', '@OUTDIR@', '@INPUT@'], - build_by_default: true) +config_noop = configuration_data() +# Set a dummy replacement to silence meson warnings: +# meson.build:487: WARNING: Got an empty configuration_data() object and +# found no substitutions in the input file 'foo'. If you +# want to copy a file to the build dir, use the 'copy:' +# keyword argument added in 0.47.0 +config_noop.set('dummy', 'dummy') + +doxyfiles = [] +foreach f : src_doxygen + df = configure_file(input: f, + output: '@PLAINNAME@', + configuration : config_noop, + install : false) + doxyfiles += [ df ] +endforeach doc_config = configuration_data() doc_config.set('PACKAGE_NAME', meson.project_name()) @@ -63,9 +74,9 @@ doxyfile = configure_file(input : 'libinput.doxygen.in', install : false) custom_target('doxygen', - input : [ doxyfile, mainpage ] + src_doxygen, + input : [ doxyfiles, doxyfile, mainpage ] + src_doxygen, output : [ '.' ], command : [ doxygen, doxyfile ], install : false, - depends: [doxyfiles, mainpage ], + depends: [ mainpage ], build_by_default : true) diff --git a/doc/user/meson.build b/doc/user/meson.build index c481331a..943e100d 100644 --- a/doc/user/meson.build +++ b/doc/user/meson.build @@ -86,7 +86,7 @@ foreach s404 : src_404s endif endforeach -src_extra = [ +src_rst = files( # dot drawings 'dot/seats-sketch.gv', 'dot/seats-sketch-libinput.gv', @@ -127,9 +127,7 @@ src_extra = [ 'svg/touchscreen-gestures.svg', 'svg/trackpoint-delta-illustration.svg', 'svg/twofinger-scrolling.svg', -] - -src_rst = files( + # rst files 'absolute-axes.rst', 'absolute-coordinate-ranges.rst', 'architecture.rst', @@ -169,19 +167,28 @@ src_rst = files( 'configuration.rst', ) -src_sphinx = custom_target('sphinx-sources', - input : [src_rst, src_extra], - output : '.', - command : [prg_install, '-t', '@OUTDIR@', '@INPUT@'], - build_by_default: true) +config_noop = configuration_data() +# Set a dummy replacement to silence meson warnings: +# meson.build:487: WARNING: Got an empty configuration_data() object and +# found no substitutions in the input file 'foo'. If you +# want to copy a file to the build dir, use the 'copy:' +# keyword argument added in 0.47.0 +config_noop.set('dummy', 'dummy') +src_sphinx = [] +foreach f : src_rst + sf = configure_file(input: f, + output: '@PLAINNAME@', + configuration : config_noop, + install : false) + src_sphinx += [ sf ] +endforeach # do not use -j, it breaks on Ubuntu sphinx_output_dir = 'Documentation' custom_target('sphinx', - input : [ sphinx_conf_py, git_version_page ] + src_rst + src_extra + dst_404s, + input : [ sphinx_conf_py, git_version_page ] + src_sphinx + dst_404s, output : [ sphinx_output_dir ], command : [ sphinx, '-q', '-b', 'html', meson.current_build_dir(), sphinx_output_dir], - depends: [ src_sphinx ], build_by_default : true) diff --git a/meson.build b/meson.build index b3c98874..29e8490a 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project('libinput', 'c', 'cpp', version : '1.11.901', license : 'MIT/Expat', default_options : [ 'c_std=gnu99', 'warning_level=2' ], - meson_version : '>= 0.40.0') + meson_version : '>= 0.41.0') libinput_version = meson.project_version().split('.')