diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..29788b8 --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + CompilationDatabase: . diff --git a/.gitignore b/.gitignore index 6c8853a..1471c72 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 bf03518..5f6b3be 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", diff --git a/build.sh b/build.sh index e3b02d6..dad2d83 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() {