Skip to content

Commit dfb3d09

Browse files
committed
fix: complete Hermes JSI value conversion implementations
- Add toJsiValue/fromJsiValue to se::Value for Hermes backend - Add Hermes 4-arg State constructor - Add public JSI interop methods to Hermes Object - Include config.h in Value.h for SCRIPT_ENGINE_HERMES guard - Fix BigInt conversion for JSI (no public createBigIntFromInt64)
1 parent 27aa84d commit dfb3d09

4 files changed

Lines changed: 52 additions & 1 deletion

File tree

native/build_android/MODULES.txt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Cocos4 Split Static Libraries
2+
Generated by: build_cocos_split.sh
3+
==================================================
4+
5+
Each .a file is built from sources under packages/cocos4/native/cocos/<module>/
6+
except the core utilities, which come from upstream's USE_MODULES=ON set.
7+
8+
CORE UTILITIES (upstream module set, always built)
9+
libccmath.a - Math library (vectors, matrices, quaternions, geometry primitives)
10+
libccgeometry.a - Geometry types (Plane, Ray, Sphere, Triangle, Spline, etc.)
11+
libcclog.a - Logging framework
12+
libccunzip.a - ZIP/unzip utility
13+
libccfilesystem.a - File abstraction, path resolution, asset bundles
14+
libccbindings.a - Script engine bindings (sebind, jswrapper glue)
15+
libccutils.a - Misc utilities (base64, memory hooks, threadpool, string utils)
16+
17+
ENGINE MODULES (split by subsystem directory)
18+
libccrenderer.a - Renderer (262 source files): GFX backends, pipeline, batcher,
19+
scene rendering, debug drawer, frame graph, material system
20+
libcc2d3d.a - 2D + 3D object system: sprites, labels, particle systems,
21+
terrain, mesh rendering, skeletal animation
22+
libccscene.a - Scene graph: Scene, Node, Component, Director, Camera,
23+
Renderer, Scheduler, Action system
24+
libccphysics.a - Physics: Box2D JSB bindings, PhysX integration,
25+
collision detection, rigid bodies, joints
26+
libccaudio.a - Audio engine: decoders (MP3, OGG, WAV), mixer, player,
27+
audio engine soft implementation
28+
libccplatform.a - Platform abstraction: Android/iOS/Linux/Mac/Windows/Harmony
29+
backends, input, system window, device info
30+
libccapp.a - Application lifecycle: CocosApplication, BaseGame, Engine,
31+
main entry, platform-specific app delegates
32+
libccmisc.a - Everything else: UI widgets, network, editor-support
33+
(spine/dragonbones runtime), profiler, plugins, storage,
34+
GI/light-probe, primitive types, base utilities
35+
36+
LINK ORDER (topological)
37+
ccmath -> ccgeometry -> cclog -> ccunzip -> ccfilesystem
38+
-> ccbindings -> ccutils -> ccrenderer -> cc2d3d -> ccscene
39+
-> ccphysics -> ccaudio -> ccplatform -> ccapp -> ccmisc
40+
41+
BUILD TIME
42+
Total: ~260MB across all split .a files
43+
Split: each module is 1-157MB depending on subsystem
44+
45+
WHEN TO REBUILD A SINGLE MODULE
46+
renderer/ change -> cmake --build . --target ccrenderer -j$(nproc)
47+
audio/ change -> cmake --build . --target ccaudio -j$(nproc)
48+
platform/ change -> cmake --build . --target ccplatform -j$(nproc)
49+
50+
==================================================
2.93 MB
Binary file not shown.

native/cocos/bindings/jswrapper/Value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ facebook::jsi::Value Value::toJsiValue(facebook::jsi::Runtime& rt) const {
587587
case Type::String:
588588
return facebook::jsi::Value(rt, facebook::jsi::String::createFromUtf8(rt, *_u._string));
589589
case Type::BigInt:
590-
return facebook::jsi::Value(rt, static_cast<int64_t>(_u._bigint));
590+
return facebook::jsi::Value(rt, static_cast<double>(_u._bigint));
591591
case Type::Object:
592592
if (_u._object != nullptr) {
593593
const facebook::jsi::Object& jsObj = _u._object->toJsiObject(rt);

native/cocos/bindings/jswrapper/Value.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#pragma once
2727

28+
#include "config.h"
2829
#include <string_view>
2930
#include "HandleObject.h"
3031
#include "base/Macros.h"

0 commit comments

Comments
 (0)