Переименование целей для анализаторов
This commit is contained in:
parent
cc5568c6a9
commit
cdfe022922
@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(myx-cmake VERSION 0.3.2 LANGUAGES)
|
||||
project(myx-cmake VERSION 0.3.3 LANGUAGES)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
|
||||
|
@ -10,7 +10,7 @@ endif()
|
||||
unset(V)
|
||||
unset(CLANG_CHECK_NAMES)
|
||||
|
||||
function(myx_cmake_clang_check_analyze target)
|
||||
function(myx_cmake_analyze_clang_check target)
|
||||
if(CLANG_CHECK_EXE)
|
||||
set(_args --analyze --extra-arg="-Wno-unknown-warning-option")
|
||||
get_target_property(__sources ${target} SOURCES)
|
||||
@ -21,13 +21,13 @@ function(myx_cmake_clang_check_analyze target)
|
||||
if(MYX_CMAKE_CLANG_ANALYZE_FIX)
|
||||
list(APPEND _args "--fixit")
|
||||
endif()
|
||||
if(NOT TARGET myx-cmake-clang-check-analyze)
|
||||
add_custom_target(myx-cmake-clang-check-analyze)
|
||||
if(NOT TARGET myx-cmake-analyze-clang-check)
|
||||
add_custom_target(myx-cmake-analyze-clang-check)
|
||||
endif()
|
||||
add_custom_target(${target}-clang-check-analyze WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
add_custom_target(${target}-analyze-clang-check WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CLANG_CHECK_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources})
|
||||
add_dependencies(${target}-clang-check-analyze ${target})
|
||||
add_dependencies(myx-cmake-clang-check-analyze ${target}-clang-check-analyze)
|
||||
add_dependencies(${target}-analyze-clang-check ${target})
|
||||
add_dependencies(myx-cmake-analyze-clang-check ${target}-analyze-clang-check)
|
||||
else()
|
||||
message(STATUS "MyxCMake: Clang Check analyzer is not found")
|
||||
endif()
|
||||
|
@ -10,7 +10,7 @@ endif()
|
||||
unset(V)
|
||||
unset(CLANG_TIDY_NAMES)
|
||||
|
||||
function(myx_cmake_clang_tidy_analyze target)
|
||||
function(myx_cmake_analyze_clang_tidy target)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set(_args -extra-arg="-Wno-unknown-warning-option")
|
||||
get_target_property(__sources ${target} SOURCES)
|
||||
@ -21,13 +21,13 @@ function(myx_cmake_clang_tidy_analyze target)
|
||||
if(MYX_CMAKE_CLANG_TIDY_FIX)
|
||||
list(APPEND _args "--fix")
|
||||
endif()
|
||||
if(NOT TARGET myx-cmake-clang-tidy-analyze)
|
||||
add_custom_target(myx-cmake-clang-tidy-analyze)
|
||||
if(NOT TARGET myx-cmake-analyze-clang-tidy)
|
||||
add_custom_target(myx-cmake-analyze-clang-tidy)
|
||||
endif()
|
||||
add_custom_target(${target}-clang-tidy-analyze WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
add_custom_target(${target}-analyze-clang-tidy WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CLANG_TIDY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources})
|
||||
add_dependencies(${target}-clang-tidy-analyze ${target})
|
||||
add_dependencies(myx-cmake-clang-tidy-analyze ${target}-clang-tidy-analyze)
|
||||
add_dependencies(${target}-analyze-clang-tidy ${target})
|
||||
add_dependencies(myx-cmake-analyze-clang-tidy ${target}-analyze-clang-tidy)
|
||||
else()
|
||||
message(STATUS "MyxCMake: Clang Tidy analyzer is not found")
|
||||
endif()
|
||||
|
@ -16,7 +16,7 @@ if(CLAZY_EXE AND CLANG_APPLY_REPLACEMENTS_EXE)
|
||||
option(MYX_CMAKE_CLAZY_FIX "MyxCMake: perform fixes for Clazy" OFF)
|
||||
endif()
|
||||
|
||||
function(myx_cmake_clazy_analyze target)
|
||||
function(myx_cmake_analyze_clazy target)
|
||||
if(CLAZY_EXE)
|
||||
set(options)
|
||||
set(oneValueArgs CHECKS)
|
||||
@ -34,21 +34,21 @@ function(myx_cmake_clazy_analyze target)
|
||||
set(_args -checks=${ARG_CHECKS} -extra-arg="-Wno-unknown-warning-option"
|
||||
-export-fixes=clazy-fixes-file.yaml)
|
||||
|
||||
if(NOT TARGET myx-cmake-clazy-analyze)
|
||||
add_custom_target(myx-cmake-clazy-analyze)
|
||||
if(NOT TARGET myx-cmake-analyze-clazy)
|
||||
add_custom_target(myx-cmake-analyze-clazy)
|
||||
endif()
|
||||
if(MYX_CMAKE_CLAZY_FIX)
|
||||
add_custom_target(
|
||||
${target}-clazy-analyze
|
||||
${target}-analyze-clazy
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources}
|
||||
COMMAND ${CLANG_APPLY_REPLACEMENTS_EXE} ${CMAKE_BINARY_DIR})
|
||||
else()
|
||||
add_custom_target(${target}-clazy-analyze WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
add_custom_target(${target}-analyze-clazy WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources})
|
||||
endif()
|
||||
add_dependencies(${target}-clazy-analyze ${target})
|
||||
add_dependencies(myx-cmake-clazy-analyze ${target}-clazy-analyze)
|
||||
add_dependencies(${target}-analyze-clazy ${target})
|
||||
add_dependencies(myx-cmake-analyze-clazy ${target}-analyze-clazy)
|
||||
else()
|
||||
message(STATUS "MyxCMake: Clazy standalone analyzer is not found")
|
||||
endif()
|
||||
|
@ -4,11 +4,11 @@ else()
|
||||
message(STATUS "MyxCMake: CMAKE_EXPORT_COMPILE_COMMANDS is not set. PVS checks will be disabled.")
|
||||
endif()
|
||||
|
||||
function(myx_cmake_pvs_studio_analyze target)
|
||||
function(myx_cmake_analyze_pvs_studio target)
|
||||
set(options)
|
||||
set(oneValueArgs CHECKS)
|
||||
set(multiValueArgs)
|
||||
if(NOT TARGET myx-cmake-pvs-studio-analyze)
|
||||
if(NOT TARGET myx-cmake-analyze-pvs-studio)
|
||||
set(PVS_STUDIO_HEADER "${CMAKE_BINARY_DIR}/include/myx_cmake_pvs_studio_header.hpp")
|
||||
file(WRITE ${PVS_STUDIO_HEADER}
|
||||
"#ifndef MYX_CMAKE_PVS_STUDIO_HEADER_HPP_\n"
|
||||
@ -17,7 +17,7 @@ function(myx_cmake_pvs_studio_analyze target)
|
||||
"//-V813_MINSIZE=33\n"
|
||||
"#endif // MYX_CMAKE_PVS_STUDIO_HEADER_HPP_\n")
|
||||
|
||||
pvs_studio_add_target(TARGET myx-cmake-pvs-studio-analyze
|
||||
pvs_studio_add_target(TARGET myx-cmake-analyze-pvs-studio
|
||||
CONFIG ${PVS_STUDIO_CONFIG}
|
||||
DEPENDS ${PVS_STUDIO_CONFIG}
|
||||
COMPILE_COMMANDS
|
||||
@ -39,8 +39,8 @@ function(myx_cmake_pvs_studio_analyze target)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS PVS_STUDIO_BIN_PATH AND EXISTS PVS_STUDIO_CONVERTER_PATH AND TARGET myx-cmake-pvs-studio-analyze)
|
||||
add_dependencies(myx-cmake-pvs-studio-analyze ${target})
|
||||
if(EXISTS PVS_STUDIO_BIN_PATH AND EXISTS PVS_STUDIO_CONVERTER_PATH AND TARGET myx-cmake-analyze-pvs-studio)
|
||||
add_dependencies(myx-cmake-analyze-pvs-studio ${target})
|
||||
get_target_property(__target_source_dir "${target}" SOURCE_DIR)
|
||||
pvs_studio_analyze_target("${target}" "${__target_source_dir}")
|
||||
endif()
|
||||
|
@ -123,10 +123,10 @@ function(myx_cmake_common_target_properties target)
|
||||
${target} ${__visibility}
|
||||
"MYX_CMAKE_LSB_CODENAME_${MYX_CMAKE_LSB_CODENAME}")
|
||||
|
||||
myx_cmake_clang_tidy_analyze(${target})
|
||||
myx_cmake_clang_check_analyze(${target})
|
||||
myx_cmake_clazy_analyze(${target})
|
||||
myx_cmake_pvs_studio_analyze(${target})
|
||||
myx_cmake_analyze_clang_tidy(${target})
|
||||
myx_cmake_analyze_clang_check(${target})
|
||||
myx_cmake_analyze_clazy(${target})
|
||||
myx_cmake_analyze_pvs_studio(${target})
|
||||
myx_cmake_format_sources(${target})
|
||||
|
||||
# Создание в каталоге ${CMAKE_BINARY_DIR} стандартных каталогов bin,include,lib
|
||||
|
Loading…
Reference in New Issue
Block a user