from subprocess import run, PIPE, STDOUT
from distutils.version import StrictVersion
-(sphinx, version, src, dst) = sys.argv[1:] # assign parameters to variables
+# assign parameters to variables
+(sphinx, version, src, dst, *extra_args) = sys.argv[1:]
# set the version in environment for sphinx to pick up
os.environ['DPDK_VERSION'] = version
# for sphinx version >= 1.7 add parallelism using "-j auto"
ver = run([sphinx, '--version'], stdout=PIPE,
stderr=STDOUT).stdout.decode().split()[-1]
-sphinx_cmd = [sphinx]
+sphinx_cmd = [sphinx] + extra_args
if StrictVersion(ver) >= StrictVersion('1.7'):
sphinx_cmd += ['-j', 'auto']
# run sphinx, putting the html output in a "html" directory
with open(join(dst, 'sphinx_html.out'), 'w') as out:
process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')],
- check=True,
stdout=out)
# create a gcc format .d file giving all the dependencies of this doc build
with open(join(dst, '.html.d'), 'w') as d:
d.write('html: ' + ' '.join(srcfiles) + '\n')
+
+sys.exit(process.returncode)
subdir_done()
endif
+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()],
+ 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'),