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 <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Antonio Maiorano 2021-06-25 14:53:06 +00:00 committed by Tint LUCI CQ
parent 6241f962a1
commit e25a8fc7f0
2 changed files with 8 additions and 1 deletions

View File

@ -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"

View File

@ -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