From 06de7bd1ec3818612752bb7be591baa3c867f128 Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Mon, 18 May 2026 15:52:13 +0200 Subject: Refactor buildscript --- cmake/Diagnostics.cmake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cmake/Diagnostics.cmake (limited to 'cmake') diff --git a/cmake/Diagnostics.cmake b/cmake/Diagnostics.cmake new file mode 100644 index 0000000..6dcf6bb --- /dev/null +++ b/cmake/Diagnostics.cmake @@ -0,0 +1,26 @@ +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + message(STATUS "Building with clang-specific diagnostics") + + set(CMAKE_CXX_CLANG_TIDY clang-tidy) # See .clang-tidy files + + add_compile_options( + # By default, enable all warnings + -Weverything + # Some warnings are incompatible with each other + -Wno-pre-c++20-compat-pedantic + -Wno-c++98-compat-pedantic + -Wno-switch-default + # Then there's code-style things I don't care about + -Wno-missing-designated-field-initializers + -Wno-shadow + # And functional warning I don't care about either + -Wno-cast-function-type-strict + -Wno-padded + # Due to C/C++ interop + -Wno-unsafe-buffer-usage + ) + endif() +endif() -- cgit v1.3.1