refactoring: simplify compiler version check

(cherry picked from commit 8d94d26caf)
This commit is contained in:
Jiri Suchan 2022-06-14 22:23:20 +07:00 committed by Rémi Verschelde
parent f1fdada6dc
commit daf6fdf0b7

View file

@ -186,12 +186,12 @@ def configure(env):
env.Append(CPPDEFINES=["NO_THREADS"])
if env["gdnative_enabled"]:
major, minor, patch = get_compiler_version(env)
if major < 2 or (major == 2 and minor == 0 and patch < 10):
print("GDNative support requires emscripten >= 2.0.10, detected: %s.%s.%s" % (major, minor, patch))
cc_semver = tuple(get_compiler_version(env))
if cc_semver < (2, 0, 10):
print("GDNative support requires emscripten >= 2.0.10, detected: %s.%s.%s" % cc_semver)
sys.exit(255)
if env["threads_enabled"] and major < 3 or (major == 3 and minor < 1) or (major == 3 and minor == 1 and patch < 14):
print("Threads and GDNative requires emscripten => 3.1.14, detected: %s.%s.%s" % (major, minor, patch))
if env["threads_enabled"] and cc_semver < (3, 1, 14):
print("Threads and GDNative requires emscripten => 3.1.14, detected: %s.%s.%s" % cc_semver)
sys.exit(255)
env.Append(CCFLAGS=["-s", "RELOCATABLE=1"])
env.Append(LINKFLAGS=["-s", "RELOCATABLE=1"])