Commit bb163dae authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Make more options common between builds

--keep-going isn't available until sphinx 2.0
-W turns warnings into errors which should help jenkins figure out that
the build finished with warnings
parent ad66c193
......@@ -45,10 +45,15 @@ find_package_handle_standard_args(Sphinx REQUIRED_VARS SPHINX_PACKAGE_DIR SPHINX
# sphinx.__main__ was introduced in version 1.3.
# Prior to this we need to pass sphinx.__init__ to -m
set(SPHINX_MAIN "sphinx.__init__") # for very old sphinx
set(SPHINX_NOCOLOR "")
set (SPHINX_KEEPGOING "")
if(SPHINX_VERSION VERSION_GREATER_EQUAL "1.3")
set(SPHINX_MAIN "sphinx")
set(SPHINX_MAIN "sphinx") # sphinx can be called as a module
# arguments new in sphinx 1.3
set(SPHINX_NOCOLOR "--no-color")
else()
set(SPHINX_MAIN "sphinx.__init__")
set(SPHINX_NOCOLOR "")
endif()
if(SPHINX_VERSION VERSION_GREATER_EQUAL "2.0")
# arguments new in sphinx 2.0
set (SPHINX_KEEPGOING "--keep-going")
endif()
......@@ -8,10 +8,11 @@ set(DOCTREE_DIR ${CMAKE_CURRENT_BINARY_DIR}/doctree)
# We try to execute Sphinx directly through python -m to avoid problems with the
# startup scripts on Windows. They are not always reliable as they can have
# hardcoded paths in them.
# -W turns warnings into errors
add_custom_target(dev-docs-${BUILDER}
COMMAND ${Python_EXECUTABLE} -m ${SPHINX_MAIN} ${SPHINX_NO_COLOR}
-w dev_docs_warnings.txt
-W --keep-going -b ${BUILDER}
-W ${SPHINX_KEEPGOING} -b ${BUILDER}
-d ${DOCTREE_DIR} ${CMAKE_CURRENT_LIST_DIR}/source
${OUT_DIR}
COMMENT "Building html developer documentation")
......
......@@ -49,7 +49,8 @@ function (add_sphinx_build_target builder math_renderer)
set(conf_builder ${SPHINX_CONF_DIR}/conf-${builder}.py)
endif()
set(sphinx_options ${SPHINX_NOCOLOR} -b ${builder} -d ${DOCTREES_DIR})
# -W turns warnings into errors
set(sphinx_options -W ${SPHINX_NOCOLOR} ${SPHINX_KEEPGOING} -b ${builder} -d ${DOCTREES_DIR})
# add a tag to differentiate between html/qthelp in conf
if(ARGC GREATER 3)
set(sphinx_options ${sphinx_options} -t ${ARGV3})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment