From 4bc687b83bad9717d40272bb7cbe02fb91eaf8b1 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Wed, 15 Feb 2023 19:28:54 -0500 Subject: [PATCH] Add .clangd file to simplify project sharing with non-CDT In the example CMake project add a .clangd to enable pointing clangd at the appropriate compilation database without having to make a copy of it. --- .gitattributes | 1 + cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF | 2 +- cmake/org.eclipse.cdt.cmake.core/templates/simple/.clangd | 4 ++++ .../org.eclipse.cdt.cmake.core/templates/simple/manifest.xml | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 cmake/org.eclipse.cdt.cmake.core/templates/simple/.clangd diff --git a/.gitattributes b/.gitattributes index ee3680e5655..56f38997e44 100644 --- a/.gitattributes +++ b/.gitattributes @@ -152,6 +152,7 @@ test_commands text # Other special files cdtOptions text .clang-format text +.clangd text .contentsettings text *.csv text *.dia binary diff --git a/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF b/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF index 5a6e1a23fab..f6cbeeafbb3 100644 --- a/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF +++ b/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.cmake.core;singleton:=true -Bundle-Version: 1.5.0.qualifier +Bundle-Version: 1.5.100.qualifier Bundle-Activator: org.eclipse.cdt.cmake.core.internal.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, diff --git a/cmake/org.eclipse.cdt.cmake.core/templates/simple/.clangd b/cmake/org.eclipse.cdt.cmake.core/templates/simple/.clangd new file mode 100644 index 00000000000..63d78d29f88 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core/templates/simple/.clangd @@ -0,0 +1,4 @@ +CompileFlags: + # When using clangd update this entry to point at the desired + # configuration directory to pick up the compile_commands.json + CompilationDatabase: build/default diff --git a/cmake/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml b/cmake/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml index 0ec38ab3025..b0502b66875 100644 --- a/cmake/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml +++ b/cmake/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml @@ -1,4 +1,6 @@ +