Исправлено разрешение автоматического исправления ошибок

This commit is contained in:
Andrei Astafev 2020-04-18 18:45:46 +03:00
parent d709a6d555
commit 255f0f432b

View File

@ -8,14 +8,15 @@ find_program(
clang-check-6.0 clang-check-6.0
clang-check) clang-check)
if(CLANG_CHECK_EXE) if(CLANG_CHECK_EXE)
option(CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF) option(CMLIB_CLANG_ANALYZE_FIX "Perform fixes for Clang-Check" OFF)
endif() endif()
function(add_clang_analyze_check target) function(add_clang_analyze_check target)
set(_sources ${ARGN}) set(_sources ${ARGN})
set(_args -analyze -extra-arg="-Wno-unknown-warning-option")
if(CLANG_CHECK_EXE) if(CLANG_CHECK_EXE)
if(CLANG_CHECK_FIX) if(CMLIB_CLANG_ANALYZE_FIX)
list(APPEND _args "-fix") list(APPEND _args "-fix")
endif() endif()
if(NOT TARGET clang-analyze-check) if(NOT TARGET clang-analyze-check)
@ -23,8 +24,7 @@ function(add_clang_analyze_check target)
endif() endif()
add_custom_target( add_custom_target(
clang-analyze-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} clang-analyze-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CLANG_CHECK_EXE} -analyze -extra-arg="-Wno-unknown-warning-option" -p ${CMAKE_BINARY_DIR} COMMAND ${CLANG_CHECK_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
${_sources})
add_dependencies(clang-analyze-check-${target} ${target}) add_dependencies(clang-analyze-check-${target} ${target})
add_dependencies(clang-analyze-check clang-analyze-check-${target}) add_dependencies(clang-analyze-check clang-analyze-check-${target})
else() else()