cmake: check again for unknown documentation commands

This commit is contained in:
Anonymous Maarten 2023-01-26 00:43:39 +01:00 committed by Sam Lantinga
parent cc0fa00049
commit b8adf90aa3
1 changed files with 19 additions and 3 deletions

View File

@ -578,10 +578,26 @@ if(USE_GCC OR USE_CLANG)
endif()
endif()
target_compile_options(sdl-global-options INTERFACE "-Wdocumentation")
endif()
check_c_compiler_flag(-fcomment-block-commands=threadsafety HAVE_GCC_COMMENT_BLOCK_COMMANDS)
if(HAVE_GCC_COMMENT_BLOCK_COMMANDS)
target_compile_options(sdl-global-options INTERFACE "-fcomment-block-commands=threadsafety")
check_c_compiler_flag(-Wdocumentation-unknown-command HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND)
if(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND)
if(SDL_WERROR)
check_c_compiler_flag(-Werror=documentation-unknown-command HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND)
if(HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND)
target_compile_options(sdl-global-options INTERFACE "-Werror=documentation-unknown-command")
endif()
endif()
target_compile_options(sdl-global-options INTERFACE "-Wdocumentation-unknown-command")
endif()
check_c_compiler_flag(-fcomment-block-commands=threadsafety HAVE_GCC_COMMENT_BLOCK_COMMANDS)
if(HAVE_GCC_COMMENT_BLOCK_COMMANDS)
target_compile_options(sdl-global-options INTERFACE "-fcomment-block-commands=threadsafety")
else()
check_c_compiler_flag(/clang:-fcomment-block-commands=threadsafety HAVE_CLANG_COMMENT_BLOCK_COMMANDS)
if(HAVE_CLANG_COMMENT_BLOCK_COMMANDS)
target_compile_options(sdl-global-options INTERFACE "/clang:-fcomment-block-commands=threadsafety")
endif()
endif()