Change: [Script] detection of not properly closed DOXYGEN_API blocks

pull/621/head
glx22 4 months ago committed by Loïc Guilloux
parent 623df6b94f
commit 4c1ddb1479

@ -71,13 +71,23 @@ reset_reader()
file(STRINGS "${SCRIPT_API_FILE}" SOURCE_LINES)
set(NUM_LINE 0)
macro(doxygen_check)
if(NOT "${DOXYGEN_SKIP}" STREQUAL "")
message(FATAL_ERROR "${SCRIPT_API_FILE}:${NUM_LINE}: a DOXYGEN_API block was not properly closed")
endif()
endmacro()
foreach(LINE IN LISTS SOURCE_LINES)
math(EXPR NUM_LINE "${NUM_LINE} + 1")
# Ignore special doxygen blocks
if("${LINE}" MATCHES "^#ifndef DOXYGEN_API")
doxygen_check()
set(DOXYGEN_SKIP "next")
continue()
endif()
if("${LINE}" MATCHES "^#ifdef DOXYGEN_API")
doxygen_check()
set(DOXYGEN_SKIP "true")
continue()
endif()
@ -86,10 +96,10 @@ foreach(LINE IN LISTS SOURCE_LINES)
continue()
endif()
if("${LINE}" MATCHES "^#else")
if("${DOXYGEN_SKIP}" STREQUAL "next")
if(DOXYGEN_SKIP STREQUAL "next")
set(DOXYGEN_SKIP "true")
else()
unset(DOXYGEN_SKIP)
elseif(DOXYGEN_SKIP STREQUAL "true")
set(DOXYGEN_SKIP "false")
endif()
continue()
endif()
@ -668,4 +678,6 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
endforeach()
doxygen_check()
configure_file(${SCRIPT_API_SOURCE_FILE} ${SCRIPT_API_BINARY_FILE})

Loading…
Cancel
Save