1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-09-03 07:30:53 +02:00

add cmake tools option to easy dynamic setup

This commit is contained in:
ClausKlein 2022-03-30 06:32:14 +02:00
parent 2cf15bc347
commit aa02116995
3 changed files with 14 additions and 2 deletions

View file

@ -10,6 +10,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
# enables sanitizers support using the the `USE_SANITIZER` flag available values are: Address,
# Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined'
set(USE_SANITIZER
"Address;Undefined"
CACHE STRING "one or more of: Address, Memory, MemoryWithOrigins, Undefined, Thread, Leak"
)
if(USE_SANITIZER OR USE_STATIC_ANALYZER)
CPMAddPackage("gh:StableCoder/cmake-scripts#1f822d1fc87c8d7720c074cde8a278b44963c354")
@ -17,6 +21,10 @@ if(USE_SANITIZER OR USE_STATIC_ANALYZER)
include(${cmake-scripts_SOURCE_DIR}/sanitizers.cmake)
endif()
set(USE_STATIC_ANALYZER
""
CACHE STRING "one or more of: clang-tidy, iwyu, cppcheck"
)
if(USE_STATIC_ANALYZER)
if("clang-tidy" IN_LIST USE_STATIC_ANALYZER)
set(CLANG_TIDY
@ -61,6 +69,7 @@ if(USE_SANITIZER OR USE_STATIC_ANALYZER)
endif()
# enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent
option(USE_CCACHE "enables ccache support" YES)
if(USE_CCACHE)
CPMAddPackage("gh:TheLartians/Ccache.cmake@1.2.3")
endif()