From d5dc8c7bba45cd35a2525d8cfc8dc2d364591518 Mon Sep 17 00:00:00 2001 From: Alan George Date: Tue, 7 Apr 2026 22:53:15 -0600 Subject: [PATCH 1/2] Initial changes to get compile_commands.json/clangd enabled --- .clangd | 2 ++ .gitignore | 1 + CMakePresets.json | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .clangd diff --git a/.clangd b/.clangd new file mode 100644 index 00000000..29788b89 --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + CompilationDatabase: . diff --git a/.gitignore b/.gitignore index 6c8853a7..1471c729 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ lib/ *.exe livekit.log web/ +compile_commands.json diff --git a/CMakePresets.json b/CMakePresets.json index bf035187..5f6b3be3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -38,7 +38,8 @@ "hidden": true, "generator": "Ninja", "cacheVariables": { - "LIVEKIT_USE_VCPKG": "OFF" + "LIVEKIT_USE_VCPKG": "OFF", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" }, "condition": { "type": "equals", @@ -51,7 +52,8 @@ "hidden": true, "generator": "Ninja", "cacheVariables": { - "LIVEKIT_USE_VCPKG": "OFF" + "LIVEKIT_USE_VCPKG": "OFF", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" }, "condition": { "type": "equals", From add1f5f4f7a1ba22d65947205057272ca32fbb11 Mon Sep 17 00:00:00 2001 From: Alan George Date: Wed, 8 Apr 2026 12:17:19 -0600 Subject: [PATCH 2/2] Now symlink compile_commands regardless of build config --- build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sh b/build.sh index e3b02d6a..dad2d83b 100755 --- a/build.sh +++ b/build.sh @@ -152,6 +152,11 @@ configure() { cmake -S . -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" fi fi + + if [[ -f "${BUILD_DIR}/compile_commands.json" ]]; then + ln -sf "${BUILD_DIR}/compile_commands.json" "${PROJECT_ROOT}/compile_commands.json" + echo "==> Symlinked compile_commands.json -> ${BUILD_DIR}/compile_commands.json" + fi } build() {