[SCons] Fixed crashes in several scripts
parent
5cdc2fc099
commit
0e5975dd26
|
@ -5,7 +5,6 @@ import platform
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from binding_generator import scons_generate_bindings, scons_emit_files
|
from binding_generator import scons_generate_bindings, scons_emit_files
|
||||||
from SCons.Errors import UserError
|
|
||||||
|
|
||||||
|
|
||||||
EnsureSConsVersion(4, 0)
|
EnsureSConsVersion(4, 0)
|
||||||
|
|
|
@ -29,7 +29,7 @@ def generate(env):
|
||||||
|
|
||||||
if env["arch"] not in ("arm64", "x86_64", "arm32", "x86_32"):
|
if env["arch"] not in ("arm64", "x86_64", "arm32", "x86_32"):
|
||||||
print("Only arm64, x86_64, arm32, and x86_32 are supported on Android. Exiting.")
|
print("Only arm64, x86_64, arm32, and x86_32 are supported on Android. Exiting.")
|
||||||
Exit()
|
env.Exit(1)
|
||||||
|
|
||||||
if sys.platform == "win32" or sys.platform == "msys":
|
if sys.platform == "win32" or sys.platform == "msys":
|
||||||
my_spawn.configure(env)
|
my_spawn.configure(env)
|
||||||
|
|
|
@ -3,6 +3,7 @@ import os, sys, platform
|
||||||
from SCons.Variables import EnumVariable, PathVariable, BoolVariable
|
from SCons.Variables import EnumVariable, PathVariable, BoolVariable
|
||||||
from SCons.Tool import Tool
|
from SCons.Tool import Tool
|
||||||
from SCons.Builder import Builder
|
from SCons.Builder import Builder
|
||||||
|
from SCons.Errors import UserError
|
||||||
|
|
||||||
from binding_generator import scons_generate_bindings, scons_emit_files
|
from binding_generator import scons_generate_bindings, scons_emit_files
|
||||||
|
|
||||||
|
@ -226,7 +227,7 @@ def generate(env):
|
||||||
env["arch"] = "x86_32"
|
env["arch"] = "x86_32"
|
||||||
else:
|
else:
|
||||||
print("Unsupported CPU architecture: " + host_machine)
|
print("Unsupported CPU architecture: " + host_machine)
|
||||||
Exit()
|
env.Exit(1)
|
||||||
|
|
||||||
print("Building for architecture " + env["arch"] + " on platform " + env["platform"])
|
print("Building for architecture " + env["arch"] + " on platform " + env["platform"])
|
||||||
|
|
||||||
|
@ -284,8 +285,8 @@ def _godot_cpp(env):
|
||||||
)
|
)
|
||||||
# Forces bindings regeneration.
|
# Forces bindings regeneration.
|
||||||
if env["generate_bindings"]:
|
if env["generate_bindings"]:
|
||||||
AlwaysBuild(bindings)
|
env.AlwaysBuild(bindings)
|
||||||
NoCache(bindings)
|
env.NoCache(bindings)
|
||||||
|
|
||||||
# Sources to compile
|
# Sources to compile
|
||||||
sources = []
|
sources = []
|
||||||
|
|
|
@ -8,7 +8,7 @@ def exists(env):
|
||||||
def generate(env):
|
def generate(env):
|
||||||
if env["arch"] not in ("wasm32"):
|
if env["arch"] not in ("wasm32"):
|
||||||
print("Only wasm32 supported on web. Exiting.")
|
print("Only wasm32 supported on web. Exiting.")
|
||||||
Exit()
|
env.Exit(1)
|
||||||
|
|
||||||
if "EM_CONFIG" in os.environ:
|
if "EM_CONFIG" in os.environ:
|
||||||
env["ENV"] = os.environ
|
env["ENV"] = os.environ
|
||||||
|
|
|
@ -20,7 +20,7 @@ def exists(env):
|
||||||
def generate(env):
|
def generate(env):
|
||||||
if env["arch"] not in ("universal", "arm64", "x86_64"):
|
if env["arch"] not in ("universal", "arm64", "x86_64"):
|
||||||
print("Only universal, arm64, and x86_64 are supported on macOS. Exiting.")
|
print("Only universal, arm64, and x86_64 are supported on macOS. Exiting.")
|
||||||
Exit()
|
env.Exit(1)
|
||||||
|
|
||||||
if sys.platform == "darwin":
|
if sys.platform == "darwin":
|
||||||
# Use clang on macOS by default
|
# Use clang on macOS by default
|
||||||
|
|
Loading…
Reference in New Issue