Skip to content

Commit b6e947d

Browse files
committed
Merge pull request #104148 from YeldhamDev/scons_move_env_checks
Make SConstruct file check some envs before querying modules
2 parents b7eda9d + f1304a3 commit b6e947d

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

SConstruct

+25-25
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,31 @@ suffix += env.extra_suffix
930930
sys.path.remove(tmppath)
931931
sys.modules.pop("detect")
932932

933+
if env["disable_3d"]:
934+
if env.editor_build:
935+
print_error("Build option `disable_3d=yes` cannot be used for editor builds, only for export template builds.")
936+
Exit(255)
937+
else:
938+
env.Append(CPPDEFINES=["_3D_DISABLED"])
939+
env["disable_xr"] = True
940+
if env["disable_advanced_gui"]:
941+
if env.editor_build:
942+
print_error(
943+
"Build option `disable_advanced_gui=yes` cannot be used for editor builds, only for export template builds."
944+
)
945+
Exit(255)
946+
else:
947+
env.Append(CPPDEFINES=["ADVANCED_GUI_DISABLED"])
948+
if env["disable_xr"]:
949+
env.Append(CPPDEFINES=["XR_DISABLED"])
950+
if env["minizip"]:
951+
env.Append(CPPDEFINES=["MINIZIP_ENABLED"])
952+
if env["brotli"]:
953+
env.Append(CPPDEFINES=["BROTLI_ENABLED"])
954+
955+
if not env["verbose"]:
956+
methods.no_verbose(env)
957+
933958
modules_enabled = OrderedDict()
934959
env.module_dependencies = {}
935960
env.module_icons_paths = []
@@ -999,31 +1024,6 @@ env["SHLIBSUFFIX"] = suffix + env["SHLIBSUFFIX"]
9991024
env["OBJPREFIX"] = env["object_prefix"]
10001025
env["SHOBJPREFIX"] = env["object_prefix"]
10011026

1002-
if env["disable_3d"]:
1003-
if env.editor_build:
1004-
print_error("Build option `disable_3d=yes` cannot be used for editor builds, only for export template builds.")
1005-
Exit(255)
1006-
else:
1007-
env.Append(CPPDEFINES=["_3D_DISABLED"])
1008-
env["disable_xr"] = True
1009-
if env["disable_advanced_gui"]:
1010-
if env.editor_build:
1011-
print_error(
1012-
"Build option `disable_advanced_gui=yes` cannot be used for editor builds, only for export template builds."
1013-
)
1014-
Exit(255)
1015-
else:
1016-
env.Append(CPPDEFINES=["ADVANCED_GUI_DISABLED"])
1017-
if env["disable_xr"]:
1018-
env.Append(CPPDEFINES=["XR_DISABLED"])
1019-
if env["minizip"]:
1020-
env.Append(CPPDEFINES=["MINIZIP_ENABLED"])
1021-
if env["brotli"]:
1022-
env.Append(CPPDEFINES=["BROTLI_ENABLED"])
1023-
1024-
if not env["verbose"]:
1025-
methods.no_verbose(env)
1026-
10271027
GLSL_BUILDERS = {
10281028
"RD_GLSL": env.Builder(
10291029
action=env.Run(glsl_builders.build_rd_headers),

0 commit comments

Comments
 (0)