Web: Fix version check for missing scalbnf LTO workaround

The check needs to happen after we set `env["CXX"]`.
Follow-up to #81340.

(cherry picked from commit 50161808c2)
This commit is contained in:
Rémi Verschelde 2023-09-18 16:32:13 +02:00
parent a7c5e3134a
commit 0a81659d9b
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -111,10 +111,6 @@ def configure(env):
else:
env.Append(CCFLAGS=["-flto"])
env.Append(LINKFLAGS=["-flto"])
# Workaround https://github.com/emscripten-core/emscripten/issues/19781.
cc_semver = tuple(get_compiler_version(env))
if cc_semver >= (3, 1, 42):
env.Append(LINKFLAGS=["-Wl,-u,scalbnf"])
# Sanitizers
if env["use_ubsan"]:
@ -193,8 +189,15 @@ def configure(env):
else:
env.Append(CPPDEFINES=["NO_THREADS"])
if env["gdnative_enabled"]:
# Get version info for checks below.
cc_semver = tuple(get_compiler_version(env))
if env["lto"] != "none":
# Workaround https://github.com/emscripten-core/emscripten/issues/19781.
if cc_semver >= (3, 1, 42) and cc_semver < (3, 1, 46):
env.Append(LINKFLAGS=["-Wl,-u,scalbnf"])
if env["gdnative_enabled"]:
if cc_semver < (2, 0, 10):
print("GDNative support requires emscripten >= 2.0.10, detected: %s.%s.%s" % cc_semver)
sys.exit(255)