Files
dx12-starter/cmake/staticanalysis.cmake
2024-04-05 12:03:20 +00:00

16 lines
459 B
CMake

include_guard()
function(target_enable_static_analysis _target)
set(_VS_CLANG_TIDY "false")
find_program(CLANGTIDY clang-tidy)
if(CLANGTIDY)
set(_VS_CLANG_TIDY "true")
endif()
set_target_properties(
${_target}
PROPERTIES
VS_GLOBAL_EnableMicrosoftCodeAnalysis true
VS_GLOBAL_CodeAnalysisRuleSet "AllRules.ruleset"
VS_GLOBAL_EnableClangTidyCodeAnalysis "${_VS_CLANG_TIDY}"
)
endfunction()