Merge pull request #66242 from akien-mga/scons-unify-tools-target

This commit is contained in:
Rémi Verschelde 2022-09-30 12:28:50 +02:00 committed by GitHub
commit f47979f087
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 215 additions and 338 deletions

View file

@ -40,12 +40,12 @@ if not env.msvc:
else:
env_basisu.Prepend(CPPPATH=[thirdparty_dir])
if env["target"] == "debug":
if env.dev_build:
env_basisu.Append(CPPDEFINES=[("BASISU_DEVEL_MESSAGES", 1), ("BASISD_ENABLE_DEBUG_FLAGS", 1)])
env_thirdparty = env_basisu.Clone()
env_thirdparty.disable_warnings()
if env["tools"]:
if env.editor_build:
env_thirdparty.Append(CPPDEFINES=["BASISU_NO_IMG_LOADERS"])
env_thirdparty.add_source_files(thirdparty_obj, encoder_sources)
env_thirdparty.add_source_files(thirdparty_obj, transcoder_sources)

View file

@ -7,5 +7,5 @@ env_csg = env_modules.Clone()
# Godot source files
env_csg.add_source_files(env.modules_sources, "*.cpp")
if env["tools"]:
if env.editor_build:
env_csg.add_source_files(env.modules_sources, "editor/*.cpp")

View file

@ -1,5 +1,5 @@
def can_build(env, platform):
return env["tools"]
return env.editor_build
def configure(env):

View file

@ -5,7 +5,7 @@ def can_build(env, platform):
# as doing lightmap generation and denoising on Android or Web
# would be a bit far-fetched.
desktop_platforms = ["linuxbsd", "macos", "windows"]
return env["tools"] and platform in desktop_platforms and env["arch"] == "x86_64"
return env.editor_build and platform in desktop_platforms and env["arch"] == "x86_64"
def configure(env):

View file

@ -1,5 +1,5 @@
def can_build(env, platform):
return env["tools"]
return env.editor_build
def configure(env):

View file

@ -90,7 +90,7 @@ if env["builtin_freetype"]:
env.Prepend(CPPPATH=[thirdparty_dir + "/include"])
env_freetype.Append(CPPDEFINES=["FT2_BUILD_LIBRARY", "FT_CONFIG_OPTION_USE_PNG", "FT_CONFIG_OPTION_SYSTEM_ZLIB"])
if env["target"] == "debug":
if env.dev_build:
env_freetype.Append(CPPDEFINES=["ZLIB_DEBUG"])
# Also requires libpng headers

View file

@ -7,7 +7,7 @@ env_gdscript = env_modules.Clone()
env_gdscript.add_source_files(env.modules_sources, "*.cpp")
if env["tools"]:
if env.editor_build:
env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp")
SConscript("editor/script_templates/SCsub")

View file

@ -9,5 +9,5 @@ env_gltf = env_modules.Clone()
env_gltf.add_source_files(env.modules_sources, "*.cpp")
env_gltf.add_source_files(env.modules_sources, "structures/*.cpp")
SConscript("extensions/SCsub")
if env["tools"]:
if env.editor_build:
env_gltf.add_source_files(env.modules_sources, "editor/*.cpp")

View file

@ -7,5 +7,5 @@ env_gridmap = env_modules.Clone()
# Godot source files
env_gridmap.add_source_files(env.modules_sources, "*.cpp")
if env["tools"]:
if env.editor_build:
env_gridmap.add_source_files(env.modules_sources, "editor/*.cpp")

View file

@ -26,6 +26,6 @@ if env["platform"] in ["macos", "ios"]:
elif env["platform"] == "android":
env_mono.add_source_files(env.modules_sources, "mono_gd/android_mono_config.gen.cpp")
if env["tools"]:
if env.editor_build:
env_mono.add_source_files(env.modules_sources, "editor/*.cpp")
SConscript("editor/script_templates/SCsub")

View file

@ -20,10 +20,7 @@ def configure(env, env_mono):
# is_ios = env["platform"] == "ios"
# is_ios_sim = is_ios and env["arch"] in ["x86_32", "x86_64"]
tools_enabled = env["tools"]
if tools_enabled and not module_supports_tools_on(env["platform"]):
raise RuntimeError("This module does not currently support building for this platform with tools enabled")
if env["tools"]:
if env.editor_build:
if not module_supports_tools_on(env["platform"]):
raise RuntimeError("This module does not currently support building for this platform for editor builds.")
env_mono.Append(CPPDEFINES=["GD_MONO_HOT_RELOAD"])

View file

@ -7,7 +7,7 @@ def can_build(env, platform):
if env["arch"].startswith("rv"):
return False
if env["tools"]:
if env.editor_build:
env.module_add_dependencies("mono", ["regex"])
return True

View file

@ -8,7 +8,7 @@ env_mp = env_modules.Clone()
module_obj = []
env_mp.add_source_files(module_obj, "*.cpp")
if env["tools"]:
if env.editor_build:
env_mp.add_source_files(module_obj, "editor/*.cpp")
env.modules_sources += module_obj

View file

@ -57,7 +57,7 @@ env.modules_sources += thirdparty_obj
module_obj = []
env_navigation.add_source_files(module_obj, "*.cpp")
if env["tools"]:
if env.editor_build:
env_navigation.add_source_files(module_obj, "editor/*.cpp")
env.modules_sources += module_obj

View file

@ -98,7 +98,7 @@ env_openxr.add_source_files(module_obj, "extensions/openxr_fb_passthrough_extens
env.modules_sources += module_obj
if env["tools"]:
if env.editor_build:
SConscript("editor/SCsub")
# Needed to force rebuilding the module files when the thirdparty library is updated.

View file

@ -448,7 +448,7 @@ if env["builtin_icu"]:
icu_data_name = "icudt71l.dat"
if env_icu["tools"]:
if env.editor_build:
env_icu.Depends("#thirdparty/icu4c/icudata.gen.h", "#thirdparty/icu4c/" + icu_data_name)
env_icu.Command("#thirdparty/icu4c/icudata.gen.h", "#thirdparty/icu4c/" + icu_data_name, make_icu_data)
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/icu4c/"])
@ -482,7 +482,7 @@ if env["builtin_icu"]:
"-DICU_DATA_NAME=" + icu_data_name,
]
)
if env_text_server_adv["tools"]:
if env.editor_build:
env_text_server_adv.Append(CXXFLAGS=["-DICU_STATIC_DATA"])
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])

View file

@ -193,7 +193,7 @@ if env["freetype_enabled"]:
"FT_CONFIG_OPTION_SYSTEM_ZLIB",
]
)
if env["target"] == "debug":
if env.dev_build:
env_freetype.Append(CPPDEFINES=["ZLIB_DEBUG"])
env.Append(CPPDEFINES=["MODULE_FREETYPE_ENABLED"])

View file

@ -188,7 +188,7 @@ if env["freetype_enabled"]:
"FT_CONFIG_OPTION_SYSTEM_ZLIB",
]
)
if env["target"] == "debug":
if env.dev_build:
env_freetype.Append(CPPDEFINES=["ZLIB_DEBUG"])
env.Append(CPPDEFINES=["MODULE_FREETYPE_ENABLED"])

View file

@ -1,5 +1,5 @@
def can_build(env, platform):
return env["tools"]
return env.editor_build
def configure(env):

View file

@ -41,7 +41,7 @@ elif env["builtin_wslay"]:
module_obj = []
env_ws.add_source_files(module_obj, "*.cpp")
if env["tools"]:
if env.editor_build:
env_ws.add_source_files(module_obj, "editor/*.cpp")
env.modules_sources += module_obj

View file

@ -1,5 +1,5 @@
def can_build(env, platform):
return env["tools"] and platform not in ["android", "ios"]
return env.editor_build and platform not in ["android", "ios"]
def configure(env):