Skip to content

Commit 77038d3

Browse files
authored
Add support for clangd language server (#602)
1 parent a7a33e2 commit 77038d3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ packages
99
# The solution files get generated by vcpkg on Windows
1010
# and by the C# Dev Kit within a dev container.
1111
*.sln
12+
13+
# clangd language server support
14+
compile_commands.json
15+
.cache

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if (UNIX AND NOT CMAKE_BUILD_TYPE)
1111
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Specifies the build type on single-configuration generators" FORCE)
1212
endif ()
1313

14+
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
15+
1416
set(CMAKE_DEBUG_POSTFIX d)
1517
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/${VCPKG_TARGET_TRIPLET})
1618
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/${VCPKG_TARGET_TRIPLET})

build_unix.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,8 @@ do
8383
build_dir=build/$triplet-$(tr A-Z a-z <<<$build_type)
8484
cmake -B $build_dir -S . -D VCPKG_TARGET_TRIPLET=$triplet -D CMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -D CMAKE_BUILD_TYPE=$build_type $options
8585
cmake --build $build_dir -j ${nproc}
86-
done
86+
if [ "${build_type}" == "Debug" ]
87+
then
88+
ln -snf $build_dir/compile_commands.json .
89+
fi
90+
done

0 commit comments

Comments
 (0)