Skip to content

Commit

Permalink
Adding clang-tidy cmake files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jholloc committed Jan 22, 2024
1 parent 392d943 commit 9e32074
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
Checks: '-*,readability-identifier-naming'
CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: _ }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
WarningsAsErrors: '-*'
HeaderFilterRegex: '*.h'
FormatStyle: llvm
20 changes: 20 additions & 0 deletions cmake/StaticAnalyzers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if( ENABLE_CLANG_TIDY )
find_program( CLANGTIDY clang-tidy )
if( CLANGTIDY )
set( CMAKE_CXX_CLANG_TIDY ${CLANGTIDY} -extra-arg=-Wno-unknown-warning-option )
message( "Clang-Tidy finished setting up." )
else()
message( SEND_ERROR "Clang-Tidy requested but executable not found." )
endif()
endif()

if( ENABLE_CPPCHECK )
find_program( CPPCHECK cppcheck )
if( CPPCHECK )
set( CMAKE_CXX_CPPCHECK ${CPPCHECK} --suppress=missingInclude --enable=all
--inline-suppr --inconclusive -i ${CMAKE_SOURCE_DIR}/imgui/lib )
message( "Cppcheck finished setting up." )
else()
message( SEND_ERROR "Cppcheck requested but executable not found." )
endif()
endif()

0 comments on commit 9e32074

Please sign in to comment.