diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-09 12:36:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 12:36:11 +0100 |
commit | 4af46132c2619e9b9a20d8174f3803bf8b16d6e3 (patch) | |
tree | 9956447ce54d499dcad930719343dacc276d0935 | |
parent | d239312e7b53e2ad1b47b3c61911dc0bbbe96413 (diff) | |
parent | 648b8c4489bdf0fe1d2beff737a147c5c38d66d7 (diff) | |
download | redot-cpp-4af46132c2619e9b9a20d8174f3803bf8b16d6e3.tar.gz |
Merge pull request #1303 from Repiteo/is_msvc-and-use_hot_reload-fix
Fix `is_msvc` and `use_hot_reload` variables
-rw-r--r-- | tools/godotcpp.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/godotcpp.py b/tools/godotcpp.py index 8e7e1c6..fcf4dd7 100644 --- a/tools/godotcpp.py +++ b/tools/godotcpp.py @@ -179,7 +179,7 @@ def options(opts, env): BoolVariable( key="use_hot_reload", help="Enable the extra accounting required to support hot reload.", - default=(env.get("target", "template_debug") != "template_release"), + default=env.get("use_hot_reload", None), ) ) @@ -245,9 +245,20 @@ def generate(env): print("Building for architecture " + env["arch"] + " on platform " + env["platform"]) + if env.get("use_hot_reload") is None: + env["use_hot_reload"] = env["target"] != "template_release" if env["use_hot_reload"]: env.Append(CPPDEFINES=["HOT_RELOAD_ENABLED"]) + tool = Tool(env["platform"], toolpath=["tools"]) + + if tool is None or not tool.exists(env): + raise ValueError("Required toolchain not found for platform " + env["platform"]) + + tool.generate(env) + target_tool = Tool("targets", toolpath=["tools"]) + target_tool.generate(env) + # Disable exception handling. Godot doesn't use exceptions anywhere, and this # saves around 20% of binary size and very significant build time. if env["disable_exceptions"]: @@ -258,15 +269,6 @@ def generate(env): elif env.get("is_msvc", False): env.Append(CXXFLAGS=["/EHsc"]) - tool = Tool(env["platform"], toolpath=["tools"]) - - if tool is None or not tool.exists(env): - raise ValueError("Required toolchain not found for platform " + env["platform"]) - - tool.generate(env) - target_tool = Tool("targets", toolpath=["tools"]) - target_tool.generate(env) - # Require C++17 if env.get("is_msvc", False): env.Append(CXXFLAGS=["/std:c++17"]) |