Skip to content

Commit

Permalink
Add .clangd file to simplify project sharing with non-CDT
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jonahgraham committed Feb 16, 2023
1 parent cb367f0 commit 4bc687b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ test_commands text
# Other special files
cdtOptions text
.clang-format text
.clangd text
.contentsettings text
*.csv text
*.dia binary
Expand Down
2 changes: 1 addition & 1 deletion cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions cmake/org.eclipse.cdt.cmake.core/templates/simple/.clangd
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<templateManifest>
<file src="/templates/simple/.clangd"
dest="/${projectName}/.clangd"/>
<file src="/templates/simple/CMakeLists.txt"
dest="/${projectName}/CMakeLists.txt"/>
<file src="/templates/simple/config.h.in"
Expand Down

0 comments on commit 4bc687b

Please sign in to comment.