From 7c3fe84e26729d95cda7ea3c3a14c0aafab0a3a6 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Sun, 19 May 2024 11:35:27 +0200 Subject: [PATCH] Turn on EXPORT_COMPILE_COMMANDS To make `clangd` work properly, one may need to make symbolic links ``` cd daemon ln -sf $PWD/build/tools/debug/arm64-v8a/compile_commands.json build ``` --- .gitignore | 1 + build.gradle.kts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f395cc62dfc..b4a5eabfb47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .project .settings +.cache *.iml .gradle /local.properties diff --git a/build.gradle.kts b/build.gradle.kts index 3bc073f16bf..6bf835f3d2d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,7 +35,8 @@ cmaker { arrayOf( "-DEXTERNAL_ROOT=${File(rootDir.absolutePath, "external")}", "-DCORE_ROOT=${File(rootDir.absolutePath, "core/src/main/jni")}", - "-DANDROID_STL=none" + "-DANDROID_STL=none", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", ) ) val flags = arrayOf( @@ -88,6 +89,7 @@ subprojects { externalNativeBuild { cmake { version = "3.28.1+" + buildStagingDirectory = layout.buildDirectory.get().asFile } }