Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmake/godotcpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function(godotcpp_generate)
godot_arch_name( ARCH_NAME )

# Transform options into generator expressions
set(HOT_RELOAD-UNSET "$<STREQUAL:${GODOTCPP_USE_HOT_RELOAD},>")
set(HOT_RELOAD "$<BOOL:${GODOTCPP_USE_HOT_RELOAD}>")

set(DISABLE_EXCEPTIONS "$<BOOL:${GODOTCPP_DISABLE_EXCEPTIONS}>")

Expand All @@ -337,7 +337,6 @@ function(godotcpp_generate)
### Define our godot-cpp library targets
# Generator Expressions that rely on the target
set(DEBUG_FEATURES "$<NOT:$<STREQUAL:${GODOTCPP_TARGET},template_release>>")
set(HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},${DEBUG_FEATURES},$<BOOL:${GODOTCPP_USE_HOT_RELOAD}>>")

# Suffix Generator Expression
string(
Expand Down
4 changes: 2 additions & 2 deletions cmake/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ function(linux_options)
the docs (https://docs.godotengine.org/en/latest/tutorials/scripting/cpp/build_system/cmake.html)
for examples.
]]
option(GODOTCPP_USE_STATIC_CPP "Link libgcc and libstdc++ statically for better portability" OFF)
option(GODOTCPP_USE_STATIC_CPP "Link libgcc and libstdc++ statically for better portability" ON)
endfunction()

#[===========================[ Target Generation ]===========================]
function(linux_generate)
set(STATIC_CPP "$<BOOL:${GODOTCPP_USE_STATIC_CPP}>")
set(STATIC_CPP "$<AND:$<BOOL:${GODOTCPP_USE_STATIC_CPP}>,$<NOT:${HOT_RELOAD}>>")

target_compile_definitions(godot-cpp PUBLIC LINUX_ENABLED UNIX_ENABLED)

Expand Down
4 changes: 2 additions & 2 deletions tools/godotcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def options(opts, env):
BoolVariable(
key="use_hot_reload",
help="Enable the extra accounting required to support hot reload.",
default=env.get("use_hot_reload", None),
default=env.get("use_hot_reload", False),
)
)

Expand Down Expand Up @@ -454,7 +454,7 @@ def generate(env):
print("Building for architecture " + env["arch"] + " on platform " + env["platform"])

# These defaults may be needed by platform tools
env.use_hot_reload = env.get("use_hot_reload", env["target"] != "template_release")
env.use_hot_reload = env["use_hot_reload"]
env.editor_build = env["target"] == "editor"
env.dev_build = env["dev_build"]
env.debug_features = env["target"] in ["editor", "template_debug"]
Expand Down
6 changes: 5 additions & 1 deletion tools/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def options(opts):
opts.Add(BoolVariable("use_llvm", "Use the LLVM compiler - only effective when targeting Linux", False))
opts.Add(BoolVariable("use_static_cpp", "Link libgcc and libstdc++ statically for better portability", False))
opts.Add(BoolVariable("use_static_cpp", "Link libgcc and libstdc++ statically for better portability", True))


def exists(env):
Expand All @@ -20,6 +20,10 @@ def generate(env):
# Required for extensions to truly unload.
env.Append(CXXFLAGS=["-fno-gnu-unique"])

if env.use_hot_reload:
# Reload won't work with "use_static_cpp", so disable it.
env["use_static_cpp"] = False

env.Append(CCFLAGS=["-fPIC", "-Wwrite-strings"])
env.Append(LINKFLAGS=["-Wl,-R,'$$ORIGIN'"])

Expand Down
Loading