if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if(CMAKE_C_COMPILER_ID STREQUAL "Clang") message(STATUS "Building with clang-specific diagnostics") set(CMAKE_C_CLANG_TIDY clang-tidy) # See .clang-tidy files add_compile_options( # By default, enable all warnings -Weverything # Ignore C-standard compliance warnings -Wno-declaration-after-statement -Wno-pre-c23-compat -Wno-pre-c11-compat -Wno-c99-compat -Wno-c++-compat -Wno-gnu # And some other warnings -Wno-unsafe-buffer-usage # Pointer math is common -Wno-padded # Too noisy ) endif() endif()