From 2c741f8e1d934da32ad50ab79981e9ba1e66a4a7 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 16 Aug 2017 19:23:10 +0200 Subject: [PATCH] build: use --fatalwarnings with ldoc, remove check-ldoc-warnings (#1963) Instead of having a custom target with redirection magic, just use `--fatalwarnings` with ldoc. This requires ldoc 1.4.5. --- CMakeLists.txt | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b86c5149..0a3f761e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,23 +292,12 @@ if(GENERATE_DOC) add_custom_target(ldoc ALL DEPENDS ${BUILD_DIR}/doc/index.html) add_custom_command( - COMMAND ${LDOC_EXECUTABLE} . + COMMAND ${LDOC_EXECUTABLE} --fatalwarnings . OUTPUT ${BUILD_DIR}/doc/index.html WORKING_DIRECTORY ${AWE_DOC_DIR} - DEPENDS ${AWE_LUA_FILES} ${AWE_MD_FILES} ${BUILD_DIR}/docs/config.ld + DEPENDS ${AWE_SRCS} ${AWE_LUA_FILES} ${AWE_MD_FILES} ${BUILD_DIR}/docs/config.ld COMMENT "Generating API documentation" VERBATIM) - - # Run ldoc and make it fail if any warnings are generated. The - # redirection-magic swaps stdout and stderr and awk exits with a non-zero - # status if it sees at least one line of input. - # All together, this fails as soon as ldoc prints on stderr. - add_custom_target(check-ldoc-warnings - COMMAND ${LDOC_EXECUTABLE} . 3>&1 1>&2 2>&3 | awk "{ fail=1 \; print } END { exit fail }" - WORKING_DIRECTORY ${AWE_DOC_DIR} - DEPENDS ${AWE_LUA_FILES} ${AWE_MD_FILES} - ) - list(APPEND CHECK_QA_TARGETS check-ldoc-warnings) endif() # }}}