Skip to content

Commit

Permalink
fix: crash on android
Browse files Browse the repository at this point in the history
  • Loading branch information
ialex32x committed Sep 14, 2024
1 parent 7804be0 commit f1174e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ git clone https://github.com/ialex32x/GodotJS.git

```sh
# download the archive of prebuilt v8
curl https://github.com/ialex32x/GodotJS-Dependencies/releases/download/v8_r9/v8_r9.zip --output your/download/path/v8.zip
curl https://github.com/ialex32x/GodotJS-Dependencies/releases/download/v8_r11/v8_r11.zip --output your/download/path/v8.zip

# extract the zip file into your `GodotJS` directory,
# NOTE: no white space after the switch `-o`
Expand All @@ -56,7 +56,8 @@ The module directroy structure looks like this:
┃ ┣━ include
┃ ┣━ linux.x86_64.release
┃ ┣━ macos.arm64.release
┃ ┗━ windows.x86_64.release
┃ ┣━ windows_x86_64_release
┃ ┗━ ...
┣━ gridmap
┣━ ...
```
Expand Down Expand Up @@ -108,9 +109,9 @@ For more information on how to use `GodotJS` in a project, check out [GodotJSExa
- [x] Windows: x86_64
- [ ] Windows: arm64, UWP
- [x] MacOS: arm64
- [ ] MacOS: x86_64
- [x] MacOS: x86_64 (not tested)
- [x] Linux: x86_64
- [ ] Linux: arm64
- [ ] Android
- [ ] iOS
- [x] Android: arm32, arm64, x86_64 (`ndk_platform=android-24`)
- [x] iOS: arm64, x86_64 (not tested)
- [ ] WebAssembly (quickjs only)
8 changes: 6 additions & 2 deletions SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def check(condition, text):

jsb_platform = "linux" if env["platform"] == "linuxbsd" else env["platform"]
jsb_arch = env["arch"]
prebuilt_deps_url = "https://github.com/ialex32x/GodotJS-Dependencies/releases/download/v8_r10/v8_r10.zip"
prebuilt_deps_url = "https://github.com/ialex32x/GodotJS-Dependencies/releases/download/v8_r11/v8_r11.zip"
module_path = os.path.dirname(os.path.abspath("jsb.h"))
module_name = os.path.basename(module_path)
javascript_engine = "v8" if jsb_platform in ["windows", "linux", "macos", "android", "ios"] else "quickjs"
Expand All @@ -26,6 +26,10 @@ print("websocket lib:", websocket_lib)
print("platform:", jsb_platform)
print("arch:", jsb_arch)

if jsb_platform == "android":
print("ndk_platform:", env["ndk_platform"])
print("ANDROID_NDK_ROOT:", env["ANDROID_NDK_ROOT"])

class CompileDefines:
def __init__(self, name, value, help = None):
self.name = name
Expand Down Expand Up @@ -245,7 +249,7 @@ if javascript_engine == "v8":
check(False, f'v8 is not supported on {env["platform"]}')

# platform-specific defines
if jsb_platform != "ios":
if jsb_platform not in ["ios", "android"]:
env_jsb.AppendUnique(CPPDEFINES=["V8_COMPRESS_POINTERS"])
pass

Expand Down
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Core:
✔ directly use typescripts in `godot editor`, hide compiled results (.js files) @done(24-07-08)
✔ global scope defined constants (such as PropertyHint) @done
☐ source-map: incorrect Ln:Col on bundle scripts
☐ core: possible to call virtual methods even if not defined by scripts
✔ embed jsb sources in C++ @done(24-08-15 23:16)
✔ exception is swallowed if thrown in GodotJS ScriptInstance::callp method @started(24-04-30 17:52) @done(24-07-05 21:42)
✔ SArray: return a simple wrapper with address guarded scope instead of a barebone reference? (`Env::get_object_class` etc.) @done(24-08-15)
Expand Down

0 comments on commit f1174e1

Please sign in to comment.