From e25a8fc7f0d30f98979d21dae6ffd63331bfcb87 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Fri, 25 Jun 2021 14:53:06 +0000 Subject: [PATCH] Doxygen: set warning format for MSVC builds When using Visual Studio (MSVC), have Doxygen output its warnings with the file/line prefix in the MSVC standard, so that double-clicking on the warnings brings you to the right source location. Change-Id: If492f83a651cf6d4a38186c9e36ffcb57f1d72ce Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55801 Kokoro: Kokoro Commit-Queue: Antonio Maiorano Reviewed-by: Ben Clayton --- CMakeLists.txt | 7 +++++++ Doxyfile | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c46cf2698..47a130ad15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,11 +149,18 @@ if(${TINT_BUILD_DOCS}) if(TINT_DOCS_WARN_AS_ERROR) set(DOXYGEN_WARN_AS_ERROR YES) endif() + + set(DOXYGEN_WARN_FORMAT "$file:$line: $text") + if (MSVC) + set(DOXYGEN_WARN_FORMAT "$file($line): $text") + endif() + add_custom_target(tint-docs ALL COMMAND ${CMAKE_COMMAND} -E env "DOXYGEN_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/docs" "DOXYGEN_WARN_AS_ERROR=${DOXYGEN_WARN_AS_ERROR}" + "DOXYGEN_WARN_FORMAT=${DOXYGEN_WARN_FORMAT}" ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating API documentation" diff --git a/Doxyfile b/Doxyfile index 0fe2602ed9..63bbc678f9 100644 --- a/Doxyfile +++ b/Doxyfile @@ -767,7 +767,7 @@ WARN_AS_ERROR = $(DOXYGEN_WARN_AS_ERROR) # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. -WARN_FORMAT = "$file:$line: $text" +WARN_FORMAT = $(DOXYGEN_WARN_FORMAT) # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard