From 54c2a13447914664fc78e1ab19ea717630873998 Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Fri, 12 Jun 2026 13:21:58 +0200 Subject: Initial commit --- cmake/Diagnostics.cmake | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cmake/Diagnostics.cmake (limited to 'cmake/Diagnostics.cmake') diff --git a/cmake/Diagnostics.cmake b/cmake/Diagnostics.cmake new file mode 100644 index 0000000..f609d7d --- /dev/null +++ b/cmake/Diagnostics.cmake @@ -0,0 +1,24 @@ +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() -- cgit v1.3.1