aboutsummaryrefslogtreecommitdiff
path: root/.clangd
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-24 19:07:35 +0200
committerhachem <im@hachem.wtf>2026-08-24 19:07:35 +0200
commit0158611e08cebd24518b1439904905d5dacbdf35 (patch)
treee2f16d43952fed5c30532c1f4f1fb04d4ca581d2 /.clangd
parenta34c49f103c8950a57687ea3d866c244d95b4414 (diff)
[chore]: -Wall -Wextra -Werror -pedantic
Diffstat (limited to '.clangd')
-rw-r--r--.clangd49
1 files changed, 49 insertions, 0 deletions
diff --git a/.clangd b/.clangd
new file mode 100644
index 0000000..583eae4
--- /dev/null
+++ b/.clangd
@@ -0,0 +1,49 @@
+# clangd config for Donut (the `Donut` app project — src/**). mirrors the build
+# flags in premake5.lua so clangd resolves headers and macros with no
+# compile_commands.json.
+#
+# NOTE: the include paths are absolute for THIS checkout. clangd's no-database
+# fallback runs from each file's own directory, so relative includes don't
+# resolve — hence absolute. If you move the repo, re-point them (or generate a
+# compile_commands.json, e.g. `bear -- make config=debug`, which supersedes this).
+CompileFlags:
+ Add:
+ - -std=c++20
+ # our code (mirror premake5.lua includedirs)
+ - -I/Users/hachem/Dev/Donut/src
+ # vendored deps as system headers (-isystem), mirroring externalincludedirs:
+ # keeps their warnings out of our -Wall/-Wextra/-pedantic.
+ - -isystem/Users/hachem/Dev/Donut/ext/glm
+ - -isystem/Users/hachem/Dev/Donut/ext/glfw/include
+ - -isystem/Users/hachem/Dev/Donut/ext/glad/include
+ - -isystem/Users/hachem/Dev/Donut/ext/imgui
+ - -isystem/Users/hachem/Dev/Donut/ext/imgui/backends
+ - -isystem/Users/hachem/Dev/Donut/ext/ImGuizmo
+ - -isystem/Users/hachem/Dev/Donut/ext/toml11/include
+ - -isystem/Users/hachem/Dev/Donut/ext/json/single_include
+ - -isystem/Users/hachem/Dev/Donut/ext/stb
+ - -isystem/opt/homebrew/include # Vulkan / MoltenVK headers (Homebrew, macOS)
+ # defines (mirror premake5.lua; Debug is the dev default)
+ - -DGLFW_INCLUDE_NONE
+ - -DDONUT_MACOS
+ - -DDONUT_DEBUG
+ - -D_CRT_SECURE_NO_WARNINGS
+ # same strict warnings as the build. -Werror is intentionally left out so the
+ # editor shows these as warnings, not errors — the build is what enforces them.
+ - -Wall
+ - -Wextra
+ - -pedantic
+
+Diagnostics:
+ # this project pulls headers in transitively; clangd's include heuristics are
+ # noisy here and often wrong, so hush them.
+ UnusedIncludes: None
+ MissingIncludes: None
+
+---
+# Vulkan create-info structs zero-init pNext via aggregate init, so
+# -Wmissing-field-initializers is just noise there (matches the build override).
+If:
+ PathMatch: .*/platform/vulkan/.*
+CompileFlags:
+ Add: [-Wno-missing-field-initializers]