X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=doc%2Fguides%2Fmeson.build;h=9c35efb5b2001fd0b62c2d2a3d6a12d90c48692d;hb=2e4859f3b362fa2960d71dc70b77a13a24f5c228;hp=06f14882bb9519cc482335c33a0df674311af535;hpb=d02a2dab2dfb33969c74412e99720a9eaf1e703a;p=dpdk.git diff --git a/doc/guides/meson.build b/doc/guides/meson.build index 06f14882bb..9c35efb5b2 100644 --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -3,26 +3,29 @@ sphinx = find_program('sphinx-build', required: get_option('enable_docs')) -if sphinx.found() - htmldir = join_paths('share', 'doc', 'dpdk') - html_guides_build = custom_target('html_guides_build', - input: meson.current_source_dir(), - output: 'guides', - command: [sphinx, '-b', 'html', - '-d', meson.current_build_dir() + '/.doctrees', - '@INPUT@', meson.current_build_dir() + '/guides'], - build_by_default: false, - install: get_option('enable_docs'), - install_dir: htmldir) - - doc_targets += html_guides_build - doc_target_names += 'HTML_Guides' +if not sphinx.found() + subdir_done() +endif - # sphinx leaves a .buildinfo in the target directory, which we don't - # want to install. Note that sh -c has to be used, otherwise the - # env var does not get expanded if calling rm/install directly. - meson.add_install_script('sh', '-c', - 'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo') - meson.add_install_script('sh', '-c', - 'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css') +extra_sphinx_args = [] +if get_option('werror') + extra_sphinx_args += '-W' endif + +htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk') +html_guides = custom_target('html_guides', + input: files('index.rst'), + output: 'html', + command: [sphinx_wrapper, sphinx, meson.project_version(), + meson.current_source_dir(), meson.current_build_dir(), + extra_sphinx_args], + depfile: '.html.d', + build_by_default: get_option('enable_docs'), + install: get_option('enable_docs'), + install_dir: htmldir) + +install_data(files('custom.css'), + install_dir: join_paths(htmldir,'_static', 'css')) + +doc_targets += html_guides +doc_target_names += 'HTML_Guides'