Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Building from Source

ialex32x edited this pageJan 29, 2025 ·5 revisions

V8

v8 is used as the default JavaScript runtime.

Build V8 from Source (Optional)

Note

SeeSetup V8 in GodotJS if a prebuilt version of v8 fromGodotJS-Dependencies is used.

BuildingV8 from source is needed if you do not want to use the prebuilt version fromGodotJS-Dependencies. Follow the steps below:

STEP 1
Downloaddepot_tools fromhttps://storage.googleapis.com/chrome-infra/depot_tools.zip if usingWindows, and extract it to a path you want.

Otherwise, getdepot_tools from the git repository:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

STEP 2

Add thedepot_tools path into the environment variablePATH.

Onwindows:

setPATH=Your\Path\To\depot_tools;%PATH%setDEPOT_TOOLS_WIN_TOOLCHAIN=0

Note

IfDEPOT_TOOLS_WIN_TOOLCHAIN is not set,depot_tools will fail to build because it will try to use the google internal toolchain instead of the locally installed Visual Studio.

Onlinux,macos:

export PATH=Your/Path/To/depot_tools:$PATH

STEP 3

Sync and fetch v8:

cd Your/Path/To/depot_toolsgclient mkdir -p Your/Path/To/v8cd Your/Path/To/v8fetch v8cd v8git checkout refs/tags/12.4.254.20gclient sync

STEP 4

Generate build configurations:

gn gen ./out.gn/x64.release

Modify the options inout.gn/x64.release/args.gn. SeeOptions

STEP 5

Build:

ninja -C ./out.gn/x64.release v8_monolith

Options Currently Used for Building V8

Windows x64

is_component_build =falseis_debug =falsetarget_cpu ="x64"target_os ="win"v8_enable_i18n_support =falsev8_monolithic =truev8_use_external_startup_data =falsev8_enable_pointer_compression =truev8_jitless =false# jit enableduse_custom_libcxx =false# false will produce warningstreat_warnings_as_errors =false#v8_symbol_level =0# smaller libv8_enable_sandbox =false

Macos arm64

# v8_enable_backtrace = true# v8_enable_disassembler = true# v8_enable_object_print = true# v8_enable_verify_heap = truedcheck_always_on =falseis_component_build =falseis_debug =falsetarget_cpu ="arm64"v8_target_cpu ="arm64"target_os ="mac"v8_enable_i18n_support =falsev8_monolithic =truev8_use_external_startup_data =falsev8_enable_pointer_compression =truev8_jitless =false# jit enabledv8_enable_webassembly =falseuse_custom_libcxx =false# false will produce warningstreat_warnings_as_errors =false#v8_symbol_level =0# smaller libv8_enable_sandbox =falseuse_rtti =true

Setup V8 in GodotJS

Follow the instructions below to set it up:

STEP 1: Download or clone the repo into themodules directory of your Godot engine source:

cd YourGodotEngineSource/modulesgit clone https://github.com/ialex32x/GodotJS.git

STEP 2: Putv8 headers and libraries intoGodotJS, or directly download the prebuiltv8 fromGodotJS-Dependencies:

# download the archive of prebuilt v8curl https://github.com/ialex32x/GodotJS-Dependencies/releases/download/v8_12.4.254.21_r13/v8_12.4.254.21_r13.zip --output your/download/path/v8.zip# extract the zip file into your `GodotJS` directory,# NOTE: no white space after the switch `-o`7z x -o"YourGodotEngineSource/modules/GodotJS" your/download/path/v8.zip

Note

Don't forget to put the headers/libraries ofv8 into the same directory structure used in prebuiltv8 if you decide to compile it by yourself.

The module directroy structure looks like this:

┗━ godot    ┗━ modules        ┣━ ...        ┣━ gltf        ┣━ GodotJS        ┃    ┣━ bridge-quickjs        ┃    ┣━ bridge-v8        ┃    ┣━ ...        ┃    ┣━ lws        ┃    ┗━ v8        ┃        ┣━ include        ┃        ┣━ linux.x86_64.release        ┃        ┣━ macos.arm64.release        ┃        ┣━ windows_x86_64_release        ┃        ┗━ ...        ┣━ gridmap        ┣━ ...

The currently used version ofv8 is12.4.254.21.

STEP 3: Compile and launchGodot Editor. Then, you can create a Godot project in TypeScript/#"Create-a-TypeScript-Project-from-Scratch">Create-a-TypeScript-Project-from-Scratch

  • Create-a-JavaScript-Project-from-Scratch
  • Note

    Since the prebuiltv8 library is built with thewindows-latest github runner which uses VS2022, encounteringUnresolved external symbol errors during linkage withv8_monolith.lib orlibucrt.lib may be addressed by updating to the latest version of theMSVC v143 toolchain,Windows Universal CRT SDK andVisual Studio 2022 itself. SeeGodotJS-Dependencies README for the version of MSVC C++ Compiler used in different prebuilt library packages.

    A prebuilt version ofGodot Editor can be downloaded fromGodotJS-Build.
    Because the GodotJS-Build workflow is currently run manually, it may not be built from the latest commit ofGodotJS.

    JavaScriptCore

    To enableJavaScriptCore, please runscons with the parameteruse_jsc=yes.

    Note

    JavaScriptCore is only available on macOS/iOS since the system bundledJavaScriptCore.framework is used.

    # An example on macOS:scons compiledb=yes dev_build=yes use_jsc=yes

    QuickJS

    To enableQuickJS, please runscons with the parameteruse_quickjs=yes, oruse_quickjs_ng=yes ifquickjs-ng is preferred.

    Note

    QuickJS is also available for WebBuild.

    If you choosequickjs-ng, please clone the source with submodules:

    # If it's a fresh clonegit clone --recurse-submodules https://github.com/godotjs/GodotJS.git# If you've already cloned it priorgit submodule update --init --recursive

    Then, buildGodot from source:

    # An example on Windows:scons vsproj=yes dev_build=yes p=windows use_quickjs_ng=yes

    Web

    It's enabled by default for WebBuild.

    Note

    Be cautious about the JS compatibility issues between different web browsers.

    web_build.png

    Clone this wiki locally


    [8]ページ先頭

    ©2009-2025 Movatter.jp