From 44ed2642cae72d21b0a4ddf832d817717db544d6 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Thu, 11 Feb 2021 22:16:38 -0500 Subject: [PATCH] [SCons] Add configuration for Sphinx options The default will exit the Sphinx build with error code 1 if any warnings are encountered, but it will print all the warnings from a single run. Since all the warnings from Sphinx are now resolved, this change means that any CI failures due to warnings from Sphinx should be fixed before merging a pull request. --- SConstruct | 7 +++++++ doc/SConscript | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 300d6946ab..ec856c0058 100644 --- a/SConstruct +++ b/SConstruct @@ -258,6 +258,7 @@ defaults.debugLinkFlags = '' defaults.noDebugLinkFlags = '' defaults.warningFlags = '-Wall' defaults.buildPch = False +defaults.sphinx_options = '-W --keep-going' env['pch_flags'] = [] env['openmp_flag'] = ['-fopenmp'] # used to generate sample build scripts @@ -439,6 +440,12 @@ config_options = [ 'sphinx_cmd', """Command to use for building the Sphinx documentation.""", 'sphinx-build', PathVariable.PathAccept), + ( + "sphinx_options", + """Options passed to the 'sphinx_cmd' command line. Separate multiple + options with spaces, for example, "-W --keep-going".""", + defaults.sphinx_options, + ), EnumVariable( 'system_eigen', """Select whether to use Eigen from a system installation ('y'), from a diff --git a/doc/SConscript b/doc/SConscript index f513d17903..f4873fc49f 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -110,7 +110,7 @@ if localenv['sphinx_docs']: sphinxdocs = build(localenv.Command('${SPHINXBUILD}/html/index.html', 'sphinx/conf.py', - '${sphinx_cmd} -b html -d ${SPHINXBUILD}/doctrees ${SPHINXSRC} ${SPHINXBUILD}/html')) + '${sphinx_cmd} ${sphinx_options} -b html -d ${SPHINXBUILD}/doctrees ${SPHINXSRC} ${SPHINXBUILD}/html')) env.Alias('sphinx', sphinxdocs) env.Depends(sphinxdocs, env['python_module'])