diff options
author | David Snopek <dsnopek@gmail.com> | 2023-08-04 11:02:57 -0500 |
---|---|---|
committer | David Snopek <dsnopek@gmail.com> | 2023-09-25 22:13:33 -0500 |
commit | df849651d9d71e3b901fe386a6752aec368c7206 (patch) | |
tree | fc6e5fabafb682aeba91c124d7c4beebb5c9c4ef /tools | |
parent | c44c3d5ebf9826214efc971f0cbe047789af2575 (diff) | |
download | redot-cpp-df849651d9d71e3b901fe386a6752aec368c7206.tar.gz |
Changes necessary for hot reload to work
Diffstat (limited to 'tools')
-rw-r--r-- | tools/godotcpp.py | 11 | ||||
-rw-r--r-- | tools/linux.py | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/godotcpp.py b/tools/godotcpp.py index 969f8c4..c89335d 100644 --- a/tools/godotcpp.py +++ b/tools/godotcpp.py @@ -175,6 +175,14 @@ def options(opts, env): ) ) + opts.Add( + BoolVariable( + key="use_hot_reload", + help="Enable the extra accounting required to support hot reload.", + default=(env.get("target", "template_debug") != "template_release"), + ) + ) + # Add platform options for pl in platforms: tool = Tool(pl, toolpath=["tools"]) @@ -231,6 +239,9 @@ def generate(env): print("Building for architecture " + env["arch"] + " on platform " + env["platform"]) + 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): diff --git a/tools/linux.py b/tools/linux.py index cb48ae5..823b66e 100644 --- a/tools/linux.py +++ b/tools/linux.py @@ -14,6 +14,9 @@ def generate(env): if env["use_llvm"]: clang.generate(env) clangxx.generate(env) + elif env["use_hot_reload"]: + # Required for extensions to truly unload. + env.Append(CXXFLAGS=["-fno-gnu-unique"]) env.Append(CCFLAGS=["-fPIC", "-Wwrite-strings"]) env.Append(LINKFLAGS=["-Wl,-R,'$$ORIGIN'"]) |