summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-09-30 12:28:50 +0200
committerGitHub <noreply@github.com>2022-09-30 12:28:50 +0200
commitf47979f0874b2ca6134e71575fbb359c6cc5ced0 (patch)
treec5c2159d3317f1da839e390281d6f32eb82e1158 /modules
parent67961d875d518b565bc1fa923772af56fb227063 (diff)
parent39facb35a021f9301f742732fbbd3c6a5a548893 (diff)
Merge pull request #66242 from akien-mga/scons-unify-tools-target
Diffstat (limited to 'modules')
-rw-r--r--modules/basis_universal/SCsub4
-rw-r--r--modules/csg/SCsub2
-rw-r--r--modules/cvtt/config.py2
-rw-r--r--modules/denoise/config.py2
-rw-r--r--modules/etcpak/config.py2
-rw-r--r--modules/freetype/SCsub2
-rw-r--r--modules/gdscript/SCsub2
-rw-r--r--modules/gltf/SCsub2
-rw-r--r--modules/gridmap/SCsub2
-rw-r--r--modules/mono/SCsub2
-rw-r--r--modules/mono/build_scripts/mono_configure.py9
-rw-r--r--modules/mono/config.py2
-rw-r--r--modules/multiplayer/SCsub2
-rw-r--r--modules/navigation/SCsub2
-rw-r--r--modules/openxr/SCsub2
-rw-r--r--modules/text_server_adv/SCsub4
-rw-r--r--modules/text_server_adv/gdextension_build/SConstruct2
-rw-r--r--modules/text_server_fb/gdextension_build/SConstruct2
-rw-r--r--modules/tinyexr/config.py2
-rw-r--r--modules/websocket/SCsub2
-rw-r--r--modules/xatlas_unwrap/config.py2
21 files changed, 25 insertions, 28 deletions
diff --git a/modules/basis_universal/SCsub b/modules/basis_universal/SCsub
index a44a7f0db3..161b0f3814 100644
--- a/modules/basis_universal/SCsub
+++ b/modules/basis_universal/SCsub
@@ -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)
diff --git a/modules/csg/SCsub b/modules/csg/SCsub
index 55f859db11..1cf9974fc1 100644
--- a/modules/csg/SCsub
+++ b/modules/csg/SCsub
@@ -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")
diff --git a/modules/cvtt/config.py b/modules/cvtt/config.py
index 53b8f2f2e3..eb565b85b9 100644
--- a/modules/cvtt/config.py
+++ b/modules/cvtt/config.py
@@ -1,5 +1,5 @@
def can_build(env, platform):
- return env["tools"]
+ return env.editor_build
def configure(env):
diff --git a/modules/denoise/config.py b/modules/denoise/config.py
index 20a5e1da2f..27d2ffbf86 100644
--- a/modules/denoise/config.py
+++ b/modules/denoise/config.py
@@ -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):
diff --git a/modules/etcpak/config.py b/modules/etcpak/config.py
index 53b8f2f2e3..eb565b85b9 100644
--- a/modules/etcpak/config.py
+++ b/modules/etcpak/config.py
@@ -1,5 +1,5 @@
def can_build(env, platform):
- return env["tools"]
+ return env.editor_build
def configure(env):
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index 2680479acc..0b86bc569f 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -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
diff --git a/modules/gdscript/SCsub b/modules/gdscript/SCsub
index 2f507db548..1dc4768186 100644
--- a/modules/gdscript/SCsub
+++ b/modules/gdscript/SCsub
@@ -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")
diff --git a/modules/gltf/SCsub b/modules/gltf/SCsub
index 5f111165fd..d1f337715f 100644
--- a/modules/gltf/SCsub
+++ b/modules/gltf/SCsub
@@ -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")
diff --git a/modules/gridmap/SCsub b/modules/gridmap/SCsub
index da3f7d4dd9..282d772592 100644
--- a/modules/gridmap/SCsub
+++ b/modules/gridmap/SCsub
@@ -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")
diff --git a/modules/mono/SCsub b/modules/mono/SCsub
index 7764ba0b45..a4667f784d 100644
--- a/modules/mono/SCsub
+++ b/modules/mono/SCsub
@@ -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")
diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py
index 5d63773096..5cec8f41f5 100644
--- a/modules/mono/build_scripts/mono_configure.py
+++ b/modules/mono/build_scripts/mono_configure.py
@@ -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"])
diff --git a/modules/mono/config.py b/modules/mono/config.py
index 15fe79ef8c..a36083b64b 100644
--- a/modules/mono/config.py
+++ b/modules/mono/config.py
@@ -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
diff --git a/modules/multiplayer/SCsub b/modules/multiplayer/SCsub
index ff33655537..e89038c3e0 100644
--- a/modules/multiplayer/SCsub
+++ b/modules/multiplayer/SCsub
@@ -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
diff --git a/modules/navigation/SCsub b/modules/navigation/SCsub
index 24a6b12639..0b0822db2d 100644
--- a/modules/navigation/SCsub
+++ b/modules/navigation/SCsub
@@ -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
diff --git a/modules/openxr/SCsub b/modules/openxr/SCsub
index c8e9b9a11e..d4469b110b 100644
--- a/modules/openxr/SCsub
+++ b/modules/openxr/SCsub
@@ -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.
diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub
index 847d8b7ee3..2261342467 100644
--- a/modules/text_server_adv/SCsub
+++ b/modules/text_server_adv/SCsub
@@ -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/"])
diff --git a/modules/text_server_adv/gdextension_build/SConstruct b/modules/text_server_adv/gdextension_build/SConstruct
index 488d1f641b..7ca8859ee6 100644
--- a/modules/text_server_adv/gdextension_build/SConstruct
+++ b/modules/text_server_adv/gdextension_build/SConstruct
@@ -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"])
diff --git a/modules/text_server_fb/gdextension_build/SConstruct b/modules/text_server_fb/gdextension_build/SConstruct
index 488f9ca24e..eae8e031bf 100644
--- a/modules/text_server_fb/gdextension_build/SConstruct
+++ b/modules/text_server_fb/gdextension_build/SConstruct
@@ -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"])
diff --git a/modules/tinyexr/config.py b/modules/tinyexr/config.py
index 53b8f2f2e3..eb565b85b9 100644
--- a/modules/tinyexr/config.py
+++ b/modules/tinyexr/config.py
@@ -1,5 +1,5 @@
def can_build(env, platform):
- return env["tools"]
+ return env.editor_build
def configure(env):
diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub
index 890fb71592..3f834471e5 100644
--- a/modules/websocket/SCsub
+++ b/modules/websocket/SCsub
@@ -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
diff --git a/modules/xatlas_unwrap/config.py b/modules/xatlas_unwrap/config.py
index 2e73c51626..ecc61c2d7e 100644
--- a/modules/xatlas_unwrap/config.py
+++ b/modules/xatlas_unwrap/config.py
@@ -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):