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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-08-08 11:18:20 +10:00
parent 37e21cee9c
commit 0a5dc16976
3 changed files with 37 additions and 19 deletions

View file

@ -46,11 +46,22 @@ src_doxygen = files(
'style/libinputdoxygen.css', 'style/libinputdoxygen.css',
) )
doxyfiles = custom_target('doxyfiles', config_noop = configuration_data()
input : src_doxygen, # Set a dummy replacement to silence meson warnings:
output : 'doxyfiles', # meson.build:487: WARNING: Got an empty configuration_data() object and
command : [prg_install, '-t', '@OUTDIR@', '@INPUT@'], # found no substitutions in the input file 'foo'. If you
build_by_default: true) # 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 = configuration_data()
doc_config.set('PACKAGE_NAME', meson.project_name()) doc_config.set('PACKAGE_NAME', meson.project_name())
@ -63,9 +74,9 @@ doxyfile = configure_file(input : 'libinput.doxygen.in',
install : false) install : false)
custom_target('doxygen', custom_target('doxygen',
input : [ doxyfile, mainpage ] + src_doxygen, input : [ doxyfiles, doxyfile, mainpage ] + src_doxygen,
output : [ '.' ], output : [ '.' ],
command : [ doxygen, doxyfile ], command : [ doxygen, doxyfile ],
install : false, install : false,
depends: [doxyfiles, mainpage ], depends: [ mainpage ],
build_by_default : true) build_by_default : true)

View file

@ -86,7 +86,7 @@ foreach s404 : src_404s
endif endif
endforeach endforeach
src_extra = [ src_rst = files(
# dot drawings # dot drawings
'dot/seats-sketch.gv', 'dot/seats-sketch.gv',
'dot/seats-sketch-libinput.gv', 'dot/seats-sketch-libinput.gv',
@ -127,9 +127,7 @@ src_extra = [
'svg/touchscreen-gestures.svg', 'svg/touchscreen-gestures.svg',
'svg/trackpoint-delta-illustration.svg', 'svg/trackpoint-delta-illustration.svg',
'svg/twofinger-scrolling.svg', 'svg/twofinger-scrolling.svg',
] # rst files
src_rst = files(
'absolute-axes.rst', 'absolute-axes.rst',
'absolute-coordinate-ranges.rst', 'absolute-coordinate-ranges.rst',
'architecture.rst', 'architecture.rst',
@ -169,19 +167,28 @@ src_rst = files(
'configuration.rst', 'configuration.rst',
) )
src_sphinx = custom_target('sphinx-sources', config_noop = configuration_data()
input : [src_rst, src_extra], # Set a dummy replacement to silence meson warnings:
output : '.', # meson.build:487: WARNING: Got an empty configuration_data() object and
command : [prg_install, '-t', '@OUTDIR@', '@INPUT@'], # found no substitutions in the input file 'foo'. If you
build_by_default: true) # 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 # do not use -j, it breaks on Ubuntu
sphinx_output_dir = 'Documentation' sphinx_output_dir = 'Documentation'
custom_target('sphinx', 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 ], output : [ sphinx_output_dir ],
command : [ sphinx, '-q', '-b', 'html', command : [ sphinx, '-q', '-b', 'html',
meson.current_build_dir(), sphinx_output_dir], meson.current_build_dir(), sphinx_output_dir],
depends: [ src_sphinx ],
build_by_default : true) build_by_default : true)

View file

@ -2,7 +2,7 @@ project('libinput', 'c', 'cpp',
version : '1.11.901', version : '1.11.901',
license : 'MIT/Expat', license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ], default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.40.0') meson_version : '>= 0.41.0')
libinput_version = meson.project_version().split('.') libinput_version = meson.project_version().split('.')