2.0.11
This commit is contained in:
parent
b3d19b7336
commit
f1b574cd50
@ -38,24 +38,31 @@ function(myxx)
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_property(targets DIRECTORY ${CMAKE_BINARY_DIR} PROPERTY BUILDSYSTEM_TARGETS)
|
||||
foreach(iter ${targets})
|
||||
get_target_property(target_type ${iter} TYPE)
|
||||
if((NOT ${target_type} STREQUAL "UTILITY") AND
|
||||
(NOT ${iter} MATCHES ".*_shared$" ) AND
|
||||
(NOT ${iter} MATCHES ".*_static$" )
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_property(__targets DIRECTORY ${CMAKE_BINARY_DIR} PROPERTY BUILDSYSTEM_TARGETS)
|
||||
foreach(__iter ${__targets})
|
||||
get_target_property(__target_type ${__iter} TYPE)
|
||||
|
||||
if((NOT ${__target_type} STREQUAL "UTILITY") AND
|
||||
(NOT ${__target_type} STREQUAL "INTERFACE_LIBRARY") AND
|
||||
(NOT ${__iter} MATCHES ".*_shared$" ) AND
|
||||
(NOT ${__iter} MATCHES ".*_static$" )
|
||||
)
|
||||
myxx_code_coverage(${iter})
|
||||
myxx_analyze_clang_tidy(${iter})
|
||||
myxx_analyze_clang_tidy_naming(${iter})
|
||||
myxx_analyze_clang_check(${iter})
|
||||
message(${__target_type} ${__iter})
|
||||
myxx_code_coverage(${__iter})
|
||||
myxx_analyze_clang_tidy(${__iter})
|
||||
myxx_analyze_clang_tidy_naming(${__iter})
|
||||
myxx_analyze_clang_check(${__iter})
|
||||
if(MYXX_CMAKE_CLAZY_FIX)
|
||||
myxx_analyze_clazy(${iter} FIX)
|
||||
myxx_analyze_clazy(${__iter} FIX)
|
||||
else()
|
||||
myxx_analyze_clazy(${iter})
|
||||
myxx_analyze_clazy(${__iter})
|
||||
endif()
|
||||
myxx_analyze_pvs_studio(${iter})
|
||||
myxx_add_sanitizers(${iter})
|
||||
myxx_analyze_pvs_studio(${__iter})
|
||||
myxx_add_sanitizers(${__iter})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction(myxx)
|
||||
|
@ -14,7 +14,9 @@ find_program(CLANG_CHECK_EXE NAMES ${CLANG_CHECK_NAMES})
|
||||
unset(CLANG_CHECK_NAMES)
|
||||
|
||||
function(myxx_analyze_clang_check TARGET_NAME)
|
||||
myx_skip_external_target(${TARGET_NAME})
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CLANG_CHECK_EXE)
|
||||
message(STATUS "MyxCMake: Clang Check analyzer is not found")
|
||||
|
@ -14,7 +14,9 @@ find_program(CLANG_TIDY_EXE NAMES ${CLANG_TIDY_NAMES})
|
||||
unset(CLANG_TIDY_NAMES)
|
||||
|
||||
function(myxx_analyze_clang_tidy TARGET_NAME)
|
||||
myx_skip_external_target(${TARGET_NAME})
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CLANG_TIDY_EXE)
|
||||
message(STATUS "MyxxCMake: Clang Tidy analyzer is not found")
|
||||
@ -55,7 +57,9 @@ endfunction()
|
||||
|
||||
|
||||
function(myxx_analyze_clang_tidy_naming TARGET_NAME)
|
||||
myx_skip_external_target(${TARGET_NAME})
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CLANG_TIDY_EXE)
|
||||
message(STATUS "MyxxCMake: Clang Tidy analyzer is not found")
|
||||
@ -82,10 +86,10 @@ function(myxx_analyze_clang_tidy_naming TARGET_NAME)
|
||||
|
||||
set(__cmd_args -extra-arg="-Wno-unknown-warning-option ${ARG_EXTRA_ARGS}")
|
||||
get_target_property(__sources ${TARGET_NAME} SOURCES)
|
||||
foreach(iter ${__sources})
|
||||
string(FIND ${iter} ${CMAKE_BINARY_DIR} pos)
|
||||
if(pos EQUAL -1)
|
||||
list(APPEND __filtered_sources ${iter})
|
||||
foreach(__iter ${__sources})
|
||||
string(FIND ${__iter} ${CMAKE_BINARY_DIR} __pos)
|
||||
if(__pos EQUAL -1)
|
||||
list(APPEND __filtered_sources ${__iter})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
@ -7,7 +7,9 @@ if(CLAZY_EXE AND CLANG_APPLY_REPLACEMENTS_EXE)
|
||||
endif()
|
||||
|
||||
function(myxx_analyze_clazy TARGET_NAME)
|
||||
myx_skip_external_target(${TARGET_NAME})
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CLAZY_EXE)
|
||||
message(STATUS "MyxCMake: Clazy standalone analyzer is not found")
|
||||
@ -36,10 +38,10 @@ function(myxx_analyze_clazy TARGET_NAME)
|
||||
-extra-arg=-Wno-unknown-warning-option
|
||||
-export-fixes=clazy-fixes-file.yaml)
|
||||
get_target_property(__sources ${TARGET_NAME} SOURCES)
|
||||
foreach(iter ${__sources})
|
||||
string(FIND ${iter} ${CMAKE_BINARY_DIR} pos)
|
||||
if(pos EQUAL -1)
|
||||
list(APPEND __filtered_sources ${iter})
|
||||
foreach(__iter ${__sources})
|
||||
string(FIND ${__iter} ${CMAKE_BINARY_DIR} __pos)
|
||||
if(__pos EQUAL -1)
|
||||
list(APPEND __filtered_sources ${__iter})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
@ -10,7 +10,9 @@ function(myxx_analyze_pvs_studio TARGET_NAME)
|
||||
set(CMAKE_CURRENT_FUNCTION_LIST_DIR ${MYXX_CMAKE_LIB_PVS_DIR_BACKPORT})
|
||||
endif()
|
||||
|
||||
myx_skip_external_target(${TARGET_NAME})
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT PVS_STUDIO_ANALYZER_EXE)
|
||||
message(STATUS "MyxxCMake: pvs-studio-analyzer not found.")
|
||||
@ -37,11 +39,11 @@ function(myxx_analyze_pvs_studio TARGET_NAME)
|
||||
set(ARG_MODE "GA:1,2,3;64:1,2;OP:1,2,3;CS:1,2;OWASP:1,2")
|
||||
endif()
|
||||
|
||||
get_target_property(sources ${TARGET_NAME} SOURCES)
|
||||
foreach(iter ${sources})
|
||||
string(FIND ${iter} ${CMAKE_BINARY_DIR} pos)
|
||||
if(pos EQUAL -1)
|
||||
list(APPEND srcs ${iter})
|
||||
get_target_property(__target_sources ${TARGET_NAME} SOURCES)
|
||||
foreach(__iter ${__target_sources})
|
||||
string(FIND ${__iter} ${CMAKE_BINARY_DIR} __pos)
|
||||
if(__pos EQUAL -1)
|
||||
list(APPEND __filtered_sources ${__iter})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
@ -9,7 +9,10 @@ function(myxx_code_coverage TARGET_NAME)
|
||||
if(NOT MYXX_CODE_COVERAGE)
|
||||
return()
|
||||
endif()
|
||||
myx_skip_external_target(${TARGET_NAME})
|
||||
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(options)
|
||||
set(oneValueArgs)
|
||||
|
@ -50,6 +50,10 @@ function(sanitizer_add_blacklist_file FILE)
|
||||
endfunction()
|
||||
|
||||
function(myxx_add_sanitizers ...)
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
# If no sanitizer is enabled, return immediately.
|
||||
if(NOT
|
||||
(SANITIZE_ADDRESS
|
||||
|
Loading…
x
Reference in New Issue
Block a user