-S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}
--installed ${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt
-l ${CMAKE_CURRENT_BINARY_DIR}/doxygen-check.log
+ --exitcode
--ignore ${CMAKE_CURRENT_SOURCE_DIR}/suppressions.txt
--ignore-cycles ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt)
add_custom_target(doc-check COMMAND ${doc_check_command}
help='Issue notes for comments ignored by Doxygen')
parser.add_option('-q', '--quiet', action='store_true',
help='Do not write status messages')
+ parser.add_option('--exitcode', action='store_true',
+ help='Return non-zero exit code if there are warnings')
options, args = parser.parse_args()
installedlist = []
reporter.report_unused_filters()
reporter.close_log()
+ if options.exitcode and reporter.had_warnings():
+ sys.exit(1)
+
main()
self._messages = []
self._filters = []
self._quiet = quiet
+ self._had_warnings = False
def _write(self, message):
"""Implement actual message writing."""
sys.stderr.write(wholemsg)
if self._logfp:
self._logfp.write(wholemsg)
+ self._had_warnings = True
def _report(self, message):
"""Handle a single reporter message."""
text = 'warning: unused filter: ' + filterobj.get_text()
self._write(Message(text))
+ def had_warnings(self):
+ """Return true if any warnings have been reported."""
+ return self._had_warnings
+
def close_log(self):
"""Close the log file if one exists."""
assert not self._messages