mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
build: make clang-tidy checks opt-in
This commit is contained in:
+3
-1
@@ -22,6 +22,8 @@ set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
|
|||||||
include(utils.cmake)
|
include(utils.cmake)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
|
option(KYTY_ENABLE_CLANG_TIDY "Run clang-tidy checks during builds" OFF)
|
||||||
|
|
||||||
set(KYTY_THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty")
|
set(KYTY_THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty")
|
||||||
|
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
@@ -129,7 +131,7 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0)
|
|||||||
common
|
common
|
||||||
#launcher
|
#launcher
|
||||||
)
|
)
|
||||||
list(APPEND KYTY_CLANG_TYDY
|
list(APPEND KYTY_CLANG_TIDY
|
||||||
kyty_emulator
|
kyty_emulator
|
||||||
#common
|
#common
|
||||||
launcher
|
launcher
|
||||||
|
|||||||
+2
-2
@@ -20,7 +20,7 @@ function(include_what_you_use_with_mappings target dirs mappings)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(clang_tidy_check target config headers dirs)
|
function(clang_tidy_check target config headers dirs)
|
||||||
if (CLANG AND ("${target}" IN_LIST KYTY_CLANG_TYDY) AND NOT KYTY_CLANG_CL)
|
if (KYTY_ENABLE_CLANG_TIDY AND CLANG AND ("${target}" IN_LIST KYTY_CLANG_TIDY) AND NOT KYTY_CLANG_CL)
|
||||||
find_program (CLANG_TIDY_EXE NAMES "clang-tidy")
|
find_program (CLANG_TIDY_EXE NAMES "clang-tidy")
|
||||||
if (CLANG_TIDY_EXE)
|
if (CLANG_TIDY_EXE)
|
||||||
set(std_arg "-extra-arg=-std=c++${CMAKE_CXX_STANDARD}")
|
set(std_arg "-extra-arg=-std=c++${CMAKE_CXX_STANDARD}")
|
||||||
@@ -41,7 +41,7 @@ function(clang_tidy_check target config headers dirs)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(clang_tidy_fix target config headers dirs)
|
function(clang_tidy_fix target config headers dirs)
|
||||||
if (CLANG AND ("${target}" IN_LIST KYTY_CLANG_TYDY))
|
if (KYTY_ENABLE_CLANG_TIDY AND CLANG AND ("${target}" IN_LIST KYTY_CLANG_TIDY))
|
||||||
find_program (CLANG_TIDY_EXE NAMES "clang-tidy")
|
find_program (CLANG_TIDY_EXE NAMES "clang-tidy")
|
||||||
if (CLANG_TIDY_EXE)
|
if (CLANG_TIDY_EXE)
|
||||||
set(std_arg "-extra-arg=-std=c++${CMAKE_CXX_STANDARD}")
|
set(std_arg "-extra-arg=-std=c++${CMAKE_CXX_STANDARD}")
|
||||||
|
|||||||
Reference in New Issue
Block a user