From 4b8cfdeecb4bcf0b22976e9ceb2330eb2582baa7 Mon Sep 17 00:00:00 2001 From: Tim Perkins Date: Sat, 6 Jun 2026 16:26:40 -0400 Subject: [PATCH] Add default Clangd config This will be used if the project does not provide any flags. This is useful for small one-off files, because C++20 features will work. --- containers/cpp/Containerfile | 3 +++ containers/cpp/clangd-config.yaml | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 containers/cpp/clangd-config.yaml diff --git a/containers/cpp/Containerfile b/containers/cpp/Containerfile index d30df88..6d35153 100644 --- a/containers/cpp/Containerfile +++ b/containers/cpp/Containerfile @@ -75,6 +75,9 @@ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 1000 \ && update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang-cpp 1000 \ && update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld 1000 +# Copy Clangd config +COPY clangd-config.yaml $DEV_USER_HOME/.config/clangd/config.yaml + # Include What You Use Variables (v0.20 for use with LLVM 16) ARG IWYU_TAR_URL="https://include-what-you-use.org/downloads/include-what-you-use-0.20.src.tar.gz" diff --git a/containers/cpp/clangd-config.yaml b/containers/cpp/clangd-config.yaml new file mode 100644 index 0000000..21dcedb --- /dev/null +++ b/containers/cpp/clangd-config.yaml @@ -0,0 +1,4 @@ +# ~/.config/clangd/config.yaml + +CompileFlags: + Add: ['-std=c++20', '-stdlib=libc++', '-fexperimental-library']