Исправлено разрешение автоматического исправления ошибок
This commit is contained in:
parent
d709a6d555
commit
255f0f432b
@ -8,14 +8,15 @@ find_program(
|
||||
clang-check-6.0
|
||||
clang-check)
|
||||
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()
|
||||
|
||||
function(add_clang_analyze_check target)
|
||||
set(_sources ${ARGN})
|
||||
set(_args -analyze -extra-arg="-Wno-unknown-warning-option")
|
||||
|
||||
if(CLANG_CHECK_EXE)
|
||||
if(CLANG_CHECK_FIX)
|
||||
if(CMLIB_CLANG_ANALYZE_FIX)
|
||||
list(APPEND _args "-fix")
|
||||
endif()
|
||||
if(NOT TARGET clang-analyze-check)
|
||||
@ -23,8 +24,7 @@ function(add_clang_analyze_check target)
|
||||
endif()
|
||||
add_custom_target(
|
||||
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}
|
||||
${_sources})
|
||||
COMMAND ${CLANG_CHECK_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources})
|
||||
add_dependencies(clang-analyze-check-${target} ${target})
|
||||
add_dependencies(clang-analyze-check clang-analyze-check-${target})
|
||||
else()
|
||||
|
Loading…
Reference in New Issue
Block a user