Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes strict_checks=yes
EM_VERSION: 3.1.64
EM_VERSION: 3.1.72

jobs:
web-template:
Expand All @@ -21,14 +21,14 @@ jobs:
- name: Template w/ threads (target=template_release, threads=yes)
cache-name: web-template
target: template_release
sconsflags: threads=yes
sconsflags: threads=yes arch=wasm64
tests: false
artifact: true

- name: Template w/o threads (target=template_release, threads=no)
cache-name: web-nothreads-template
target: template_release
sconsflags: threads=no
sconsflags: threads=no arch=wasm32
tests: false
artifact: true

Expand Down
4 changes: 4 additions & 0 deletions platform/web/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ for lib in sys_env["JS_LIBS"]:
sys_env.Append(LINKFLAGS=["--js-library", lib.abspath])
for js in sys_env["JS_PRE"]:
sys_env.Append(LINKFLAGS=["--pre-js", js.abspath])

# Add JS externs to Closure.
sys_env["ENV"]["EMCC_CLOSURE_ARGS"] = sys_env["ENV"].get("EMCC_CLOSURE_ARGS", "")
for ext in sys_env["JS_EXTERNS"]:
sys_env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.abspath
sys_env["ENV"]["EMCC_CLOSURE_ARGS"] = sys_env["ENV"]["EMCC_CLOSURE_ARGS"].strip()

build = []
build_targets = ["#bin/godot${PROGSUFFIX}.js", "#bin/godot${PROGSUFFIX}.wasm"]
Expand Down
11 changes: 5 additions & 6 deletions platform/web/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_flags():

def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["wasm32"]
supported_arches = ["wasm32", "wasm64"]
validate_arch(env["arch"], get_name(), supported_arches)

try:
Expand Down Expand Up @@ -171,9 +171,6 @@ def configure(env: "SConsEnvironment"):
# Add method for creating the final zip file
env.AddMethod(create_template_zip, "CreateTemplateZip")

# Closure compiler extern and support for ecmascript specs (const, let, etc).
env["ENV"]["EMCC_CLOSURE_ARGS"] = "--language_in ECMASCRIPT_2021"

env["CC"] = "emcc"
env["CXX"] = "em++"

Expand Down Expand Up @@ -201,8 +198,8 @@ def configure(env: "SConsEnvironment"):
cc_semver = (cc_version["major"], cc_version["minor"], cc_version["patch"])

# Minimum emscripten requirements.
if cc_semver < (3, 1, 62):
print_error("The minimum emscripten version to build Godot is 3.1.62, detected: %s.%s.%s" % cc_semver)
if cc_semver < (3, 1, 72):
print_error("The minimum emscripten version to build Godot is 3.1.72, detected: %s.%s.%s" % cc_semver)
sys.exit(255)

env.Prepend(CPPPATH=["#platform/web"])
Expand Down Expand Up @@ -256,6 +253,8 @@ def configure(env: "SConsEnvironment"):
env.extra_suffix = ".dlink" + env.extra_suffix

env.Append(LINKFLAGS=["-sWASM_BIGINT"])
env.Append(CCFLAGS=[f"-sMEMORY64={0 if env['arch'] == 'wasm32' else 1}"])
env.Append(LINKFLAGS=[f"-sMEMORY64={0 if env['arch'] == 'wasm32' else 1}"])

# Run the main application in a web worker
if env["proxy_to_pthread"]:
Expand Down
2 changes: 1 addition & 1 deletion platform_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

# CPU architecture options.
architectures = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32", "loongarch64"]
architectures = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32", "wasm64", "loongarch64"]
architecture_aliases = {
"x86": "x86_32",
"x64": "x86_64",
Expand Down
6 changes: 5 additions & 1 deletion thirdparty/jolt_physics/Jolt/Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@
#elif defined(JPH_PLATFORM_WASM)
// WebAssembly CPU architecture
#define JPH_CPU_WASM
#define JPH_CPU_ADDRESS_BITS 32
#if defined(__wasm64__)
#define JPH_CPU_ADDRESS_BITS 64
#else
#define JPH_CPU_ADDRESS_BITS 32
#endif
#define JPH_VECTOR_ALIGNMENT 16
#define JPH_DVECTOR_ALIGNMENT 32
#ifdef __wasm_simd128__
Expand Down