Skip to content

Instantly share code, notes, and snippets.

@theoparis
Created December 12, 2023 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theoparis/5a1e21a3408f06d1c5d8f6ac6784bc7c to your computer and use it in GitHub Desktop.
Save theoparis/5a1e21a3408f06d1c5d8f6ac6784bc7c to your computer and use it in GitHub Desktop.
standards.cmake
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_compile_options(
-Weverything
)
file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.c *.hpp *.h)
add_custom_target(
clang_tidy
COMMAND clang-tidy ${ALL_SOURCE_FILES} -p build -checks='cppcoreguidelines-*'
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
add_custom_target(
clang_tidy_fix
COMMAND clang-tidy -fix-errors ${ALL_SOURCE_FILES} -p build -checks='cppcoreguidelines-*'
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment