disable clang-tidy for normal builds

It may cause errors when cross compiling. Keep it for profiling builds
though.

Fixes #475.
This commit is contained in:
derselbst 2018-12-01 13:56:51 +01:00
parent b9c253b6d9
commit 73689925da

View file

@ -342,6 +342,18 @@ if ( enable-profiling )
endif ( )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPT_FLAGS}" )
if ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
find_program( CLANG_TIDY
NAMES "clang-tidy"
DOC "Path to clang-tidy executable" )
if ( CLANG_TIDY )
message ( STATUS "Found clang-tidy" )
set ( CMAKE_C_CLANG_TIDY "clang-tidy" )
endif ( CLANG_TIDY )
endif ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
endif ( enable-profiling )
unset ( ENABLE_TRAPONFPE CACHE )
@ -375,22 +387,6 @@ if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
set ( DEBUG 1 )
endif ( CMAKE_BUILD_TYPE MATCHES "Debug" )
if ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
find_program( CLANG_TIDY
NAMES "clang-tidy"
DOC "Path to clang-tidy executable" )
if ( CLANG_TIDY )
message ( STATUS "Found clang-tidy" )
# whenever clang-tidy is available, use it to automatically add braces after ever "make"
if ( WITH_PROFILING )
set ( CMAKE_C_CLANG_TIDY "clang-tidy" )
else ( WITH_PROFILING )
set ( CMAKE_C_CLANG_TIDY "clang-tidy;-checks=-*,readability-braces-*;-format-style=file" )
endif ( WITH_PROFILING )
endif ( CLANG_TIDY )
endif ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
# Additional targets to perform clang-format/clang-tidy
# Get all project files
file(GLOB_RECURSE