Skip to content

Commit dc9b8af

Browse files
committed
[SCons] Rename javascript tool to web
And clean it up a bit.
1 parent c4d3f01 commit dc9b8af

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

test/project/example.gdextension

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ android.debug.x86_64 = "res://bin/libgdexample.android.template_debug.x86_64.so"
2121
android.release.x86_64 = "res://bin/libgdexample.android.template_release.x86_64.so"
2222
android.debug.arm64 = "res://bin/libgdexample.android.template_debug.arm64.so"
2323
android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so"
24-
web.debug.wasm32 = "res://bin/libgdexample.javascript.template_debug.wasm32.wasm"
25-
web.release.wasm32 = "res://bin/libgdexample.javascript.template_release.wasm32.wasm"
24+
web.debug.wasm32 = "res://bin/libgdexample.web.template_debug.wasm32.wasm"
25+
web.release.wasm32 = "res://bin/libgdexample.web.template_release.wasm32.wasm"

tools/godotcpp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def validate_parent_dir(key, val, env):
3333
raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val)))
3434

3535

36-
platforms = ("linux", "macos", "windows", "android", "ios", "javascript")
36+
platforms = ("linux", "macos", "windows", "android", "ios", "web")
3737

3838
# CPU architecture options.
3939
architecture_array = [
@@ -222,7 +222,7 @@ def generate(env):
222222
env["arch"] = "universal"
223223
elif env["platform"] == "android":
224224
env["arch"] = "arm64"
225-
elif env["platform"] == "javascript":
225+
elif env["platform"] == "web":
226226
env["arch"] = "wasm32"
227227
else:
228228
host_machine = platform.machine().lower()

tools/javascript.py renamed to tools/web.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@ def generate(env):
1111
print("Only wasm32 supported on web. Exiting.")
1212
env.Exit(1)
1313

14+
# Emscripten toolchain
1415
env["CC"] = "emcc"
1516
env["CXX"] = "em++"
1617
env["AR"] = "emar"
1718
env["RANLIB"] = "emranlib"
18-
env.Append(CPPFLAGS=["-s", "SIDE_MODULE=1"])
19-
env.Append(LINKFLAGS=["-s", "SIDE_MODULE=1"])
20-
env["SHOBJSUFFIX"] = ".bc"
21-
env["SHLIBSUFFIX"] = ".wasm"
19+
2220
# Use TempFileMunge since some AR invocations are too long for cmd.exe.
2321
# Use POSIX-style paths, required with TempFileMunge.
2422
env["ARCOM_POSIX"] = env["ARCOM"].replace("$TARGET", "$TARGET.posix").replace("$SOURCES", "$SOURCES.posix")
2523
env["ARCOM"] = "${TEMPFILE(ARCOM_POSIX)}"
2624

25+
# All intermediate files are just object files.
26+
env["OBJSUFFIX"] = ".o"
27+
env["SHOBJSUFFIX"] = ".o"
28+
29+
# Static libraries clang-style.
30+
env["LIBPREFIX"] = "lib"
31+
env["LIBSUFFIX"] = ".a"
32+
33+
# Shared library as wasm.
34+
env["SHLIBSUFFIX"] = ".wasm"
35+
2736
# Thread support (via SharedArrayBuffer).
2837
env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"])
2938
env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"])
3039

31-
# All intermediate files are just LLVM bitcode.
32-
env["OBJPREFIX"] = ""
33-
env["OBJSUFFIX"] = ".bc"
34-
env["PROGPREFIX"] = ""
35-
# Program() output consists of multiple files, so specify suffixes manually at builder.
36-
env["PROGSUFFIX"] = ""
37-
env["LIBPREFIX"] = "lib"
38-
env["LIBSUFFIX"] = ".a"
39-
env["LIBPREFIXES"] = ["$LIBPREFIX"]
40-
env["LIBSUFFIXES"] = ["$LIBSUFFIX"]
41-
env.Replace(SHLINKFLAGS="$LINKFLAGS")
42-
env.Replace(SHLINKFLAGS="$LINKFLAGS")
40+
# Build as side module (shared library).
41+
env.Append(CPPFLAGS=["-s", "SIDE_MODULE=1"])
42+
env.Append(LINKFLAGS=["-s", "SIDE_MODULE=1"])
4343

4444
env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"])

0 commit comments

Comments
 (0)