mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-01 05:48:37 +03:00
Changes necessary for hot reload to work
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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'"])
|
||||
|
||||
Reference in New Issue
Block a user