Change: [Script] detection of not properly closed DOXYGEN_API blocks
This commit is contained in:
		@@ -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})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user