doc: cmake: Conditionally add USES_TERMINAL to html targets

When using Ninja, output will be buffered until the command completes
unless USES_TERMINAL is used. Use USES_TERMINAL here so that output is
sent directly to the terminal without having to wait. This is a bit of
an abuse of the Ninja console pool, but for building documentation this
should not be an issue since it's a self-contained CMake project.
Note that this is done conditionally, only when Sphinx output is not
disabled by using its "-q" flag.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2018-07-15 18:57:01 +02:00 committed by Carles Cufí
parent 7896451713
commit 60c5540dbf

View file

@ -29,6 +29,12 @@ endif()
# Internal variables.
set(ALLSPHINXOPTS -d ${CMAKE_CURRENT_BINARY_DIR}/doctrees ${SPHINXOPTS})
if("-q" IN_LIST ALLSPHINXOPTS)
set(SPHINX_USES_TERMINAL )
else()
set(SPHINX_USES_TERMINAL USES_TERMINAL)
endif()
# the i18n builder cannot share the environment and doctrees with the others
set(I18NSPHINXOPTS ${SPHINXOPTS})
@ -108,6 +114,7 @@ add_custom_target(
COMMAND ${CMAKE_COMMAND} -E remove_directory samples
COMMAND ${CMAKE_COMMAND} -E remove_directory boards
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
${SPHINX_USES_TERMINAL}
)
add_dependencies(html content doxy kconfig)