Рефакторинг
This commit is contained in:
parent
353d92da23
commit
de837bf115
@ -0,0 +1,8 @@
|
|||||||
|
set(CLANG_APPLY_REPLACEMENTS_NAMES clang-apply-replacements)
|
||||||
|
foreach(V RANGE 9 15)
|
||||||
|
list(INSERT CLANG_APPLY_REPLACEMENTS_NAMES 0 "clang-apply-replacements-${V}")
|
||||||
|
endforeach()
|
||||||
|
unset(V)
|
||||||
|
|
||||||
|
find_program(CLANG_APPLY_REPLACEMENTS_EXE NAMES ${CLANG_APPLY_REPLACEMENTS_NAMES})
|
||||||
|
unset(CLANG_APPLY_REPLACEMENTS_NAMES)
|
@ -2,12 +2,12 @@ set(CLANG_CHECK_NAMES clang-check)
|
|||||||
foreach(V RANGE 9 15)
|
foreach(V RANGE 9 15)
|
||||||
list(INSERT CLANG_CHECK_NAMES 0 "clang-check-${V}")
|
list(INSERT CLANG_CHECK_NAMES 0 "clang-check-${V}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
unset(V)
|
||||||
|
|
||||||
find_program(CLANG_CHECK_EXE NAMES ${CLANG_CHECK_NAMES})
|
find_program(CLANG_CHECK_EXE NAMES ${CLANG_CHECK_NAMES})
|
||||||
if(CLANG_CHECK_EXE)
|
if(CLANG_CHECK_EXE)
|
||||||
option(MYX_CMAKE_CLANG_CHECK_FIX "MyxCMake: perform fixes for Clang Check" OFF)
|
option(MYX_CMAKE_CLANG_CHECK_FIX "MyxCMake: perform fixes for Clang Check" OFF)
|
||||||
endif()
|
endif()
|
||||||
unset(V)
|
|
||||||
unset(CLANG_CHECK_NAMES)
|
unset(CLANG_CHECK_NAMES)
|
||||||
|
|
||||||
function(myx_cmake_analyze_clang_check target)
|
function(myx_cmake_analyze_clang_check target)
|
||||||
@ -18,7 +18,7 @@ function(myx_cmake_analyze_clang_check target)
|
|||||||
list(FILTER __sources EXCLUDE REGEX "moc_.*\\.cpp$")
|
list(FILTER __sources EXCLUDE REGEX "moc_.*\\.cpp$")
|
||||||
list(FILTER __sources EXCLUDE REGEX "ui_.*\\.h$")
|
list(FILTER __sources EXCLUDE REGEX "ui_.*\\.h$")
|
||||||
|
|
||||||
if(MYX_CMAKE_CLANG_ANALYZE_FIX)
|
if(MYX_CMAKE_CLANG_CHECK_FIX)
|
||||||
list(APPEND _args "--fixit")
|
list(APPEND _args "--fixit")
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET myx-cmake-analyze-clang-check)
|
if(NOT TARGET myx-cmake-analyze-clang-check)
|
||||||
|
@ -2,12 +2,12 @@ set(CLANG_TIDY_NAMES clang-tidy)
|
|||||||
foreach(V RANGE 9 15)
|
foreach(V RANGE 9 15)
|
||||||
list(INSERT CLANG_TIDY_NAMES 0 "clang-tidy-${V}")
|
list(INSERT CLANG_TIDY_NAMES 0 "clang-tidy-${V}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
unset(V)
|
||||||
|
|
||||||
find_program(CLANG_TIDY_EXE NAMES ${CLANG_TIDY_NAMES})
|
find_program(CLANG_TIDY_EXE NAMES ${CLANG_TIDY_NAMES})
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
option(MYX_CMAKE_CLANG_TIDY_FIX "MyxCMake: perform fixes for Clang Tidy" OFF)
|
option(MYX_CMAKE_CLANG_TIDY_FIX "MyxCMake: perform fixes for Clang Tidy" OFF)
|
||||||
endif()
|
endif()
|
||||||
unset(V)
|
|
||||||
unset(CLANG_TIDY_NAMES)
|
unset(CLANG_TIDY_NAMES)
|
||||||
|
|
||||||
function(myx_cmake_analyze_clang_tidy target)
|
function(myx_cmake_analyze_clang_tidy target)
|
||||||
|
@ -1,17 +1,5 @@
|
|||||||
find_program(CLAZY_EXE NAMES clazy-standalone)
|
find_program(CLAZY_EXE NAMES clazy-standalone)
|
||||||
|
|
||||||
set(CLANG_APPLY_REPLACEMENTS_NAMES clang-apply-replacements)
|
|
||||||
foreach(V RANGE 9 15)
|
|
||||||
list(INSERT CLANG_APPLY_REPLACEMENTS_NAMES 0 "clang-apply-replacements-${V}")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
find_program(CLANG_APPLY_REPLACEMENTS_EXE NAMES ${CLANG_APPLY_REPLACEMENTS_NAMES})
|
|
||||||
if(CLANG_TIDY_EXE)
|
|
||||||
option(MYX_CMAKE_CLANG_TIDY_FIX "MyxCMake: perform fixes for Clang Tidy" OFF)
|
|
||||||
endif()
|
|
||||||
unset(V)
|
|
||||||
unset(CLANG_TIDY_NAMES)
|
|
||||||
|
|
||||||
if(CLAZY_EXE AND CLANG_APPLY_REPLACEMENTS_EXE)
|
if(CLAZY_EXE AND CLANG_APPLY_REPLACEMENTS_EXE)
|
||||||
option(MYX_CMAKE_CLAZY_FIX "MyxCMake: perform fixes for Clazy" OFF)
|
option(MYX_CMAKE_CLAZY_FIX "MyxCMake: perform fixes for Clazy" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
@ -22,6 +22,7 @@ include(MyxCMakePrecompiledHeaders)
|
|||||||
include(MyxCMakeBuildTypes)
|
include(MyxCMakeBuildTypes)
|
||||||
include(MyxCMakeDebugOutputOptions)
|
include(MyxCMakeDebugOutputOptions)
|
||||||
|
|
||||||
|
include(MyxCMakeCodeAnalyzeApplyReplacements)
|
||||||
include(MyxCMakeCodeAnalyzeClangCheck)
|
include(MyxCMakeCodeAnalyzeClangCheck)
|
||||||
include(MyxCMakeCodeAnalyzeClangTidy)
|
include(MyxCMakeCodeAnalyzeClangTidy)
|
||||||
include(MyxCMakeCodeAnalyzeClazy)
|
include(MyxCMakeCodeAnalyzeClazy)
|
||||||
|
Loading…
Reference in New Issue
Block a user