Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

chore(native): emit compile_commands.json + a Native Host IntelliSense config

yhhdc571b1e3e0b
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index eb3c2aad0..d87c1138f 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -74,6 +74,21 @@
"cppStandard": "c++20",
"intelliSenseMode": "clang-x64",
"compileCommands": "${workspaceFolder}/build-web/compile_commands.json"
+ },
+ {
+ "name": "Native Host (Android)",
+ "includePath": [
+ "${workspaceFolder}/src",
+ "${workspaceFolder}/native/js",
+ "${workspaceFolder}/build-native/gen"
+ ],
+ "defines": [
+ "ES_ENABLE_WEBGPU"
+ ],
+ "cStandard": "c17",
+ "cppStandard": "c++20",
+ "intelliSenseMode": "linux-clang-arm64",
+ "compileCommands": "${workspaceFolder}/build-native/compile_commands.json"
}
],
"version": 4
diff --git a/build-tools/tasks/native.js b/build-tools/tasks/native.js
index 663e122b1..ec1d7e5ee 100644
--- a/build-tools/tasks/native.js
+++ b/build-tools/tasks/native.js
@@ -129,6 +129,10 @@ export async function buildNative(options = {}) {
`-DANDROID_PLATFORM=${platform}`,
'-DANDROID_STL=c++_shared',
'-DCMAKE_BUILD_TYPE=Release',
+ // Emit build-native/compile_commands.json so editor IntelliSense (the
+ // "Native Host" c_cpp_properties config) resolves the NDK / Dawn / QuickJS
+ // includes for native/js without hardcoding any machine paths.
+ '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
`-DESTELLA_DAWN_DIR=${dawnDir}`,
`-DESTELLA_DAWN_BUILD=${dawnBuild}`,
];