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.

build: eleven build trees become one, and a guard that had gone blind

esengine23205de99990
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index c07300e0a..b60bce7ef 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -84,7 +84,7 @@
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "clang-x64",
- "compileCommands": "${workspaceFolder}/build-web/compile_commands.json"
+ "compileCommands": "${workspaceFolder}/build/cmake/web/compile_commands.json"
},
{
"name": "Native Host (Android)",
@@ -99,7 +99,7 @@
"${env:EMSDK}/upstream/emscripten/cache/ports/emdawnwebgpu/emdawnwebgpu_pkg/webgpu/include",
"${env:ESTELLA_QUICKJS_DIR}",
"${workspaceFolder}/build/quickjs_headers",
- "${workspaceFolder}/build-native/gen",
+ "${workspaceFolder}/build/cmake/native/gen",
"${workspaceFolder}/build/native_intellisense",
"${workspaceFolder}/third_party/box2d/include",
"${workspaceFolder}/third_party/pl_mpeg",
@@ -116,7 +116,7 @@
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "linux-clang-arm64",
- "compileCommands": "${workspaceFolder}/build-native/compile_commands.json",
+ "compileCommands": "${workspaceFolder}/build/cmake/native/compile_commands.json",
"compilerPath": "/usr/bin/clang++"
},
{
@@ -132,7 +132,7 @@
"${env:EMSDK}/upstream/emscripten/cache/ports/emdawnwebgpu/emdawnwebgpu_pkg/webgpu/include",
"${env:ESTELLA_QUICKJS_DIR}",
"${workspaceFolder}/build/quickjs_headers",
- "${workspaceFolder}/build-native-ios/gen",
+ "${workspaceFolder}/build/cmake/native-ios/gen",
"${workspaceFolder}/build/native_intellisense",
"${workspaceFolder}/third_party/box2d/include",
"${workspaceFolder}/third_party/pl_mpeg",
@@ -149,7 +149,7 @@
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "macos-clang-arm64",
- "compileCommands": "${workspaceFolder}/build-native-ios/compile_commands.json",
+ "compileCommands": "${workspaceFolder}/build/cmake/native-ios/compile_commands.json",
"compilerPath": "/usr/bin/clang++"
}
],
diff --git a/build-tools/build.config.js b/build-tools/build.config.js
index a18ef83da..64e7a50e0 100644
--- a/build-tools/build.config.js
+++ b/build-tools/build.config.js
@@ -21,9 +21,9 @@ export default {
wasm: {
web: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
// WebGPU backend ships in the web SDK only — WeChat/playable have no
- // WebGPU and skip the emdawnwebgpu glue. Variants sharing build-web
+ // WebGPU and skip the emdawnwebgpu glue. Variants sharing build/cmake/web
// (spine*) must carry identical flags or configures would thrash.
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON'],
targets: ['esengine_sdk'],
@@ -33,7 +33,7 @@ export default {
},
},
wechat: {
- buildDir: 'build-wxgame',
+ buildDir: 'build/cmake/wxgame',
cmakeFlags: ['-DES_BUILD_WXGAME=ON', '-DES_BUILD_TESTS=OFF'],
targets: ['esengine_wxgame'],
outputs: {
@@ -42,7 +42,7 @@ export default {
},
},
physics: {
- buildDir: 'build-physics',
+ buildDir: 'build/cmake/physics',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_BOX2D=ON', '-DES_PHYSICS_ESM=ON'],
// ESM variant (EXPORT_ES6=1, `export default`) — the ONE physics build
// for every realm. The SideModuleHost loader resolves the factory the
@@ -55,7 +55,7 @@ export default {
},
},
basis: {
- buildDir: 'build-basis',
+ buildDir: 'build/cmake/basis',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_BASIS=ON'],
targets: ['basis_module'],
outputs: {
@@ -64,7 +64,7 @@ export default {
},
},
spine: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON'],
targets: ['spine_module'],
outputs: {
@@ -73,7 +73,7 @@ export default {
},
},
videodec: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON'],
targets: ['video_module'],
outputs: {
@@ -82,7 +82,7 @@ export default {
},
},
spine38: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON'],
targets: ['spine_module_38'],
outputs: {
@@ -91,7 +91,7 @@ export default {
},
},
spine41: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON'],
targets: ['spine_module_41'],
outputs: {
@@ -100,7 +100,7 @@ export default {
},
},
dragonbones: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON', '-DES_ENABLE_DRAGONBONES=ON'],
targets: ['dragonbones_module'],
outputs: {
@@ -109,7 +109,7 @@ export default {
},
},
spine21: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON'],
targets: ['spine_module_21'],
outputs: {
@@ -118,7 +118,7 @@ export default {
},
},
spine43: {
- buildDir: 'build-web',
+ buildDir: 'build/cmake/web',
cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_WEBGPU=ON'],
targets: ['spine_module_43'],
outputs: {
@@ -132,7 +132,7 @@ export default {
// separate wechat dir (synced to desktop/public/wasm-wechat) → exportWeChat
// require()s `./wasm/physics.js` / `./wasm/spine42.js` exactly as the host expects.
'physics-wechat': {
- buildDir: 'build-physics-wechat',
+ buildDir: 'build/cmake/physics-wechat',
cmakeFlags: ['-DES_BUILD_WXGAME=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_BOX2D=ON'],
targets: ['physics_module'],
outputs: {
@@ -141,7 +141,7 @@ export default {
},
},
'basis-wechat': {
- buildDir: 'build-basis-wechat',
+ buildDir: 'build/cmake/basis-wechat',
cmakeFlags: ['-DES_BUILD_WXGAME=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_BASIS=ON'],
targets: ['basis_module'],
outputs: {
@@ -150,7 +150,7 @@ export default {
},
},
'videodec-wechat': {
- buildDir: 'build-videodec-wechat',
+ buildDir: 'build/cmake/videodec-wechat',
cmakeFlags: ['-DES_BUILD_WXGAME=ON', '-DES_BUILD_TESTS=OFF'],
targets: ['video_module'],
outputs: {
@@ -159,7 +159,7 @@ export default {
},
},
'spine-wechat': {
- buildDir: 'build-spine-wechat',
+ buildDir: 'build/cmake/spine-wechat',
cmakeFlags: ['-DES_BUILD_WXGAME=ON', '-DES_BUILD_TESTS=OFF'],
targets: ['spine_module', 'spine_module_43', 'spine_module_41', 'spine_module_38', 'spine_module_21'],
outputs: {
@@ -176,7 +176,7 @@ export default {
},
},
'dragonbones-wechat': {
- buildDir: 'build-dragonbones-wechat',
+ buildDir: 'build/cmake/dragonbones-wechat',
cmakeFlags: ['-DES_BUILD_WXGAME=ON', '-DES_BUILD_TESTS=OFF', '-DES_ENABLE_DRAGONBONES=ON'],
targets: ['dragonbones_module'],
outputs: {
diff --git a/build-tools/tasks/native.js b/build-tools/tasks/native.js
index cb7b8adb3..c704e242e 100644
--- a/build-tools/tasks/native.js
+++ b/build-tools/tasks/native.js
@@ -285,7 +285,7 @@ async function buildAndroidHost(options) {
const { dawnDir, dawnBuild } = await dawnPaths(options, 'android', { ndk, cmake, ninja });
// One build tree per ABI, beside the generated sources they share — a second
// architecture must not overwrite the first one's objects.
- const buildDir = path.join(rootDir, 'build-native', abi);
+ const buildDir = path.join(rootDir, 'build/cmake/native', abi);
await mkdir(buildDir, { recursive: true });
// JS host (opt-in): pass --quickjs <dir> (or ESTELLA_QUICKJS_DIR) to also build
@@ -294,7 +294,7 @@ async function buildAndroidHost(options) {
const quickjs = quickjsDir(options);
// The generated sources are the same for every ABI (bindings, the SDK bundle,
// its bytecode), so they live once beside the per-ABI trees.
- const genDir = quickjs ? await prepareGenerated(rootDir, path.join(rootDir, 'build-native'), quickjs) : null;
+ const genDir = quickjs ? await prepareGenerated(rootDir, path.join(rootDir, 'build/cmake/native'), quickjs) : null;
logger.step(`Configuring native host (${abi}, ${platform})...`);
const configureArgs = [
@@ -306,7 +306,7 @@ async function buildAndroidHost(options) {
`-DANDROID_PLATFORM=${platform}`,
'-DANDROID_STL=c++_shared',
'-DCMAKE_BUILD_TYPE=Release',
- // Emit build-native/compile_commands.json so editor IntelliSense (the
+ // Emit build/cmake/native/compile_commands.json so editor IntelliSense (the
// "Native Host" c_cpp_properties config) resolves the NDK / Dawn / QuickJS
// includes for native/host without hardcoding any machine paths.
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
@@ -322,7 +322,7 @@ async function buildAndroidHost(options) {
logger.step('Building native host...');
await runCommand(cmake, ['--build', buildDir, '-j', String(getCpuCount())], { cwd: rootDir });
- logger.success(`Host: ${path.join('build-native', abi, 'libestella_js_host.so')}`);
+ logger.success(`Host: ${path.join('build/cmake/native', abi, 'libestella_js_host.so')}`);
// The binaries this machine just produced are the same for every game, so they
// are packed for everyone else's — see build-tools/utils/nativeTemplate.js. Only
@@ -355,10 +355,10 @@ async function iosDeveloperDir() {
// objects can never link together. The app links an .xcframework instead, and
// Xcode picks the slice matching whatever you selected in the toolbar.
const IOS_SLICES = {
- device: { dir: 'build-native-ios', sysroot: 'iphoneos', label: 'device' },
- simulator: { dir: 'build-native-ios-sim', sysroot: 'iphonesimulator', label: 'simulator' },
+ device: { dir: 'build/cmake/native-ios', sysroot: 'iphoneos', label: 'device' },
+ simulator: { dir: 'build/cmake/native-ios-sim', sysroot: 'iphonesimulator', label: 'simulator' },
};
-const XCFRAMEWORK = path.join('build-native-ios', 'Estella.xcframework');
+const XCFRAMEWORK = path.join('build/cmake/native-ios', 'Estella.xcframework');
// Rebuild the xcframework from whichever slices exist. A device-only framework is
// valid — Xcode then simply has nothing to offer a simulator target.
diff --git a/build-tools/utils/nativeTemplate.js b/build-tools/utils/nativeTemplate.js
index 5dd704e2e..fe211d0a9 100644
--- a/build-tools/utils/nativeTemplate.js
+++ b/build-tools/utils/nativeTemplate.js
@@ -79,7 +79,7 @@ export function templateLayout(platform, options = {}) {
return [
{
rel: 'Estella.xcframework', kind: 'dir',
- from: (ctx) => path.join(ctx.root, 'build-native-ios', 'Estella.xcframework'),
+ from: (ctx) => path.join(ctx.root, 'build/cmake/native-ios', 'Estella.xcframework'),
},
{ rel: 'App/main.m', from: (ctx) => path.join(ctx.root, 'native', 'ios', 'App', 'main.m') },
{ rel: 'App/Info.plist.in', from: (ctx) => path.join(ctx.root, 'native', 'ios', 'App', 'Info.plist.in') },
@@ -90,7 +90,7 @@ export function templateLayout(platform, options = {}) {
// caches instead.
{
rel: `assets/${BYTECODE_FILE}`, optional: true,
- from: (ctx) => path.join(ctx.root, 'build-native-ios', 'gen', BYTECODE_FILE),
+ from: (ctx) => path.join(ctx.root, 'build/cmake/native-ios', 'gen', BYTECODE_FILE),
},
];
}
@@ -101,7 +101,7 @@ export function templateLayout(platform, options = {}) {
const libs = abis.flatMap((abi, n) => [
{
rel: `lib/${abi}/libestella_js_host.so`, strip: true, abi, optional: n > 0,
- from: (ctx) => path.join(ctx.root, 'build-native', abi, 'libestella_js_host.so'),
+ from: (ctx) => path.join(ctx.root, 'build/cmake/native', abi, 'libestella_js_host.so'),
},
{
rel: `lib/${abi}/libwebgpu_dawn.so`, strip: true, abi, optional: n > 0,
@@ -130,7 +130,7 @@ export function templateLayout(platform, options = {}) {
// cost of a ~14 s black screen on first launch.
{
rel: `assets/${BYTECODE_FILE}`, optional: true,
- from: (ctx) => path.join(ctx.root, 'build-native', 'gen', BYTECODE_FILE),
+ from: (ctx) => path.join(ctx.root, 'build/cmake/native', 'gen', BYTECODE_FILE),
},
{
rel: 'AndroidManifest.xml.in',
diff --git a/native/README.md b/native/README.md
index b3abcf2e6..072b860d2 100644
--- a/native/README.md
+++ b/native/README.md
@@ -152,7 +152,7 @@ node build-tools/cli.js native # arm64-v8a, every real devic
node build-tools/cli.js native --abi x86_64 # adds the emulator's
```
-Per-ABI build trees live under `build-native/<abi>/`, beside the `build-native/gen/`
+Per-ABI build trees live under `build/cmake/native/<abi>/`, beside the `build/cmake/native/gen/`
they share (the bindings, the SDK bundle and its bytecode are the same for every
architecture).
@@ -184,14 +184,14 @@ and its own slice:
node build-tools/cli.js native --target ios --simulator
```
-Both slices land in `build-native-ios/Estella.xcframework`, which is what the app
+Both slices land in `build/cmake/native-ios/Estella.xcframework`, which is what the app
links — Xcode picks the one matching the toolbar. arm64 only, so an Intel Mac's
simulator would need a third Dawn. The framework and the app shell are then packed
into the iOS runtime template, which is what an editor export reads.
Then pick your Team under *Signing & Capabilities*, select your device and Run.
The CMake build merges host + engine + QuickJS + Dawn into one archive
-(`build-native-ios/libestella_ios.a`), so the Xcode project is a signing and
+(`build/cmake/native-ios/libestella_ios.a`), so the Xcode project is a signing and
packaging shell: `App/main.m` calls `EstellaRunApp()`, and the exported project
ships as bundle resources — the same project-relative paths the APK serves from
`assets/`.
@@ -297,7 +297,7 @@ SDK instance.
the CMake build works while `xcodebuild` rejects every iOS destination
("iOS X.Y is not installed"). Install it under *Xcode → Settings → Components*.
Without it you can still verify the link by hand:
- `xcrun --sdk iphoneos clang -arch arm64 -mios-version-min=17.0 native/ios/App/main.m build-native-ios/libestella_ios.a -ObjC -lc++ -framework UIKit -framework Metal -framework QuartzCore -framework Foundation -framework IOSurface -framework CoreGraphics -o /tmp/EstellaiOS`
+ `xcrun --sdk iphoneos clang -arch arm64 -mios-version-min=17.0 native/ios/App/main.m build/cmake/native-ios/libestella_ios.a -ObjC -lc++ -framework UIKit -framework Metal -framework QuartzCore -framework Foundation -framework IOSurface -framework CoreGraphics -o /tmp/EstellaiOS`
## Status
diff --git a/native/ios/project.yml b/native/ios/project.yml
index db86aa58d..321e796e9 100644
--- a/native/ios/project.yml
+++ b/native/ios/project.yml
@@ -1,6 +1,6 @@
# The iOS app shell: signing + packaging around libestella_ios.a, which
# `node build-tools/cli.js native --target ios --dawn ... --quickjs ...` produces
-# in build-native-ios/ (host + engine + QuickJS + Dawn, merged).
+# in build/cmake/native-ios/ (host + engine + QuickJS + Dawn, merged).
#
# brew install xcodegen && cd native/ios && xcodegen && open EstellaiOS.xcodeproj
#
@@ -53,7 +53,7 @@ targets:
# triples whose objects cannot link together, and Xcode picks the slice that
# matches whatever the toolbar is pointed at. Build the simulator slice with
# `cli native --target ios --simulator`.
- - framework: ../../build-native-ios/Estella.xcframework
+ - framework: ../../build/cmake/native-ios/Estella.xcframework
embed: false
- sdk: UIKit.framework
- sdk: Metal.framework
diff --git a/sdk/tests/binding-surface.test.ts b/sdk/tests/binding-surface.test.ts
index a1cbd3b59..7961fc92c 100644
--- a/sdk/tests/binding-surface.test.ts
+++ b/sdk/tests/binding-surface.test.ts
@@ -333,7 +333,7 @@ describe('WASM binding surface: side modules (C exports)', () => {
it('PhysicsWasmModule mirrors the physics module exports exactly', () => {
const cpp = new Set(
- PHYSICS_TUS.flatMap((f) => [...parseKeepaliveExports(read(resolve(CPP, 'bindings', f)))]),
+ PHYSICS_TUS.flatMap((f) => [...parseKeepaliveExports(read(resolve(CPP, 'bindings/modules/physics', f)))]),
);
const ts = parseInterfaceMethods(read(resolve(SDK, 'physics/PhysicsModuleLoader.ts')), 'PhysicsWasmModule');
expectMirrored('physics', ts, cpp);
@@ -344,10 +344,10 @@ describe('WASM binding surface: side modules (C exports)', () => {
// is an entry point the device silently does not answer — and one that exists
// there but nowhere else is a wrapper that will not link.
it('PhysicsBindings.hpp declares exactly what the module exports', () => {
- const header = stripComments(read(resolve(CPP, 'bindings/PhysicsBindings.hpp')));
+ const header = stripComments(read(resolve(CPP, 'bindings/modules/physics/PhysicsBindings.hpp')));
const declared = new Set([...header.matchAll(/\b(physics_\w+)\s*\(/g)].map((m) => m[1]!));
const exported = new Set([...PHYSICS_TUS, 'PhysicsReadback.cpp']
- .flatMap((f) => [...parseKeepaliveExports(read(resolve(CPP, 'bindings', f)))]));
+ .flatMap((f) => [...parseKeepaliveExports(read(resolve(CPP, 'bindings/modules/physics', f)))]));
const undeclared = [...exported].filter((n) => !declared.has(n)).sort();
const phantom = [...declared].filter((n) => !exported.has(n)).sort();
expect(undeclared, `exported but not declared in PhysicsBindings.hpp (no native wrapper): ${undeclared.join(', ')}`)
@@ -364,7 +364,7 @@ describe('WASM binding surface: side modules (C exports)', () => {
it('SpineWasmModule + its cwrap table mirror the spine module exports exactly', () => {
const cpp = new Set(
- [...parseKeepaliveExports(read(resolve(CPP, 'bindings/SpineModuleEntry.cpp')))]
+ [...parseKeepaliveExports(read(resolve(CPP, 'bindings/modules/spine/SpineModuleEntry.cpp')))]
.filter((n) => !SPINE_NATIVE_ONLY.has(n)),
);
const loaderTs = read(resolve(SDK, 'spine/SpineModuleLoader.ts'));
@@ -380,10 +380,10 @@ describe('WASM binding surface: side modules (C exports)', () => {
// point the device does not answer, and one with no definition is a wrapper that
// will not link.
it('SpineBindings.hpp declares exactly what the module exports', () => {
- const header = stripComments(read(resolve(CPP, 'bindings/SpineBindings.hpp')));
+ const header = stripComments(read(resolve(CPP, 'bindings/modules/spine/SpineBindings.hpp')));
const declared = new Set([...header.matchAll(/\b(spine_\w+)\s*\(/g)].map((m) => m[1]!));
const exported = new Set(
- [...parseKeepaliveExports(read(resolve(CPP, 'bindings/SpineModuleEntry.cpp')))]
+ [...parseKeepaliveExports(read(resolve(CPP, 'bindings/modules/spine/SpineModuleEntry.cpp')))]
.filter((n) => n.startsWith('spine_')),
);
const undeclared = [...exported].filter((n) => !declared.has(n)).sort();
@@ -400,7 +400,7 @@ describe('WASM binding surface: side modules (C exports)', () => {
// faithful stand-in for the table: tsc rejects a member with no `w(…)` behind it
// and a `w(…)` with no member, so the two cannot drift.
it('DragonBonesWrappedAPI mirrors the module exports exactly', () => {
- const cpp = parseKeepaliveExports(read(resolve(CPP, 'bindings/DragonBonesModuleEntry.cpp')));
+ const cpp = parseKeepaliveExports(read(resolve(CPP, 'bindings/modules/dragonbones/DragonBonesModuleEntry.cpp')));
const loaderTs = read(resolve(SDK, 'dragonbones/DragonBonesModuleLoader.ts'));
const declared = new Set(
[...parseInterfaceMethods(loaderTs, 'DragonBonesWrappedAPI')].map((n) => `_db_${n}`),
@@ -413,10 +413,10 @@ describe('WASM binding surface: side modules (C exports)', () => {
// it, because the ABI lived only in the .cpp and the generator had nothing to
// read. A declaration missing here is an entry point a device does not answer.
it('DragonBonesBindings.hpp declares exactly what the module exports', () => {
- const header = stripComments(read(resolve(CPP, 'bindings/DragonBonesBindings.hpp')));
+ const header = stripComments(read(resolve(CPP, 'bindings/modules/dragonbones/DragonBonesBindings.hpp')));
const declared = new Set([...header.matchAll(/\b(db_\w+)\s*\(/g)].map((m) => m[1]!));
const exported = new Set(
- [...parseKeepaliveExports(read(resolve(CPP, 'bindings/DragonBonesModuleEntry.cpp')))]
+ [...parseKeepaliveExports(read(resolve(CPP, 'bindings/modules/dragonbones/DragonBonesModuleEntry.cpp')))]
.filter((n) => n.startsWith('db_')),
);
const undeclared = [...exported].filter((n) => !declared.has(n)).sort();
@@ -515,7 +515,7 @@ describe('WASM binding surface: signature arity handshake', () => {
expect(parseInterfaceMethodSigs(wasmTs, 'ESEngineModule').get('draw_line')).toBe(9);
expect(parseInterfaceMethodSigs(wasmTs, 'ESEngineModule').get('renderer_end')).toBe(0);
expect(cppArities(pooledModuleCpp, 'draw_line')).toContain(9);
- expect(parseKeepaliveSigs(read(resolve(CPP, 'bindings/PhysicsModuleEntry.cpp'))).get('physics_step')).toBe(1);
+ expect(parseKeepaliveSigs(read(resolve(CPP, 'bindings/modules/physics/PhysicsModuleEntry.cpp'))).get('physics_step')).toBe(1);
expect(parseCwrapSigs(read(resolve(SDK, 'spine/SpineModuleLoader.ts'))).get('spine_setSkin')).toBe(2);
});
@@ -572,7 +572,7 @@ describe('WASM binding surface: signature arity handshake', () => {
it('physics: parameter counts match', () => {
const cpp = new Map(
['PhysicsModuleEntry.cpp', 'PhysicsShapes.cpp', 'PhysicsJoints.cpp', 'PhysicsQueries.cpp']
- .flatMap((f) => [...parseKeepaliveSigs(read(resolve(CPP, 'bindings', f)))]),
+ .flatMap((f) => [...parseKeepaliveSigs(read(resolve(CPP, 'bindings/modules/physics', f)))]),
);
const ts = parseInterfaceMethodSigs(read(resolve(SDK, 'physics/PhysicsModuleLoader.ts')), 'PhysicsWasmModule');
expectArities('physics', ts, cpp);
@@ -580,13 +580,13 @@ describe('WASM binding surface: signature arity handshake', () => {
it('spine: raw members and the cwrap table both match', () => {
const loaderTs = read(resolve(SDK, 'spine/SpineModuleLoader.ts'));
- const cpp = parseKeepaliveSigs(read(resolve(CPP, 'bindings/SpineModuleEntry.cpp')));
+ const cpp = parseKeepaliveSigs(read(resolve(CPP, 'bindings/modules/spine/SpineModuleEntry.cpp')));
expectArities('spine raw members', parseInterfaceMethodSigs(loaderTs, 'SpineWasmModule'), cpp);
expectArities('spine cwrap table', parseCwrapSigs(loaderTs), cpp);
});
it('basis: parameter counts match', () => {
- const src = stripComments(read(resolve(CPP, 'bindings/BasisModuleEntry.cpp')));
+ const src = stripComments(read(resolve(CPP, 'bindings/modules/basis/BasisModuleEntry.cpp')));
const ts = parseInterfaceMethodSigs(read(resolve(SDK, 'asset/basisTranscoder.ts')), 'BasisWasmModule');
const problems: string[] = [];
for (const [name, tsArity] of ts) {