From 790a669029688c8953208012e6f72010007a89df Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 11 Sep 2017 14:20:43 +0200 Subject: [PATCH] cmake: add strict mode for ldoc, based on STRICT_TESTS (#2035) This allows for building the docs with an older ldoc version, and it makes sense in general to make warnings not fatal by default. Ref: https://github.com/awesomeWM/awesome/pull/2027#issuecomment-328354095 --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a3f761e7..8ea83815b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,7 +268,6 @@ endif() # {{{ Lua API Documentation if(GENERATE_DOC) - if(NOT BUILD_DIR STREQUAL SOURCE_DIR) file(MAKE_DIRECTORY ${BUILD_DIR}/lib) file(MAKE_DIRECTORY ${BUILD_DIR}/doc) @@ -291,13 +290,18 @@ if(GENERATE_DOC) add_custom_target(ldoc ALL DEPENDS ${BUILD_DIR}/doc/index.html) + if (STRICT_TESTS) + set(ldoc_args --fatalwarnings .) + set(ldoc_desc_suffix " (fatal warnings)") + else() + set(ldoc_args .) + endif() add_custom_command( - COMMAND ${LDOC_EXECUTABLE} --fatalwarnings . OUTPUT ${BUILD_DIR}/doc/index.html + COMMAND ${LDOC_EXECUTABLE} ${ldoc_args} WORKING_DIRECTORY ${AWE_DOC_DIR} DEPENDS ${AWE_SRCS} ${AWE_LUA_FILES} ${AWE_MD_FILES} ${BUILD_DIR}/docs/config.ld - COMMENT "Generating API documentation" - VERBATIM) + COMMENT "Generating API documentation${ldoc_desc_suffix}") endif() # }}}