build: fix Meson build with docs=auto

When docs=auto and doxygen isn't found, the build fails with:

    doc/meson.build:28:0: ERROR: Tried to use not-found external program in "command"

Instead of always enabling docs when docs=auto, only do so when doxygen
is found.
This commit is contained in:
Simon Ser 2019-11-05 10:26:02 +01:00 committed by Jakob Bornecrantz
parent 93218fa9e4
commit 7e125ca4e6

View file

@ -37,7 +37,6 @@ add_project_arguments(cpp.get_supported_arguments([
# Pre-setting these variables # Pre-setting these variables
# #
build_docs = false
build_tracking = false build_tracking = false
v4l2_required = false v4l2_required = false
@ -49,10 +48,9 @@ openhmd_required = false
# Adding dependencies # Adding dependencies
# #
# When docs are disabled, doxygen will always appear as "not found"
doxygen = find_program('doxygen', required: get_option('docs')) doxygen = find_program('doxygen', required: get_option('docs'))
if get_option('docs').enabled() or get_option('docs').auto() build_docs = doxygen.found()
build_docs = true
endif
glslangValidator = find_program('glslangValidator') glslangValidator = find_program('glslangValidator')