diff --git a/cmake/godotcpp.cmake b/cmake/godotcpp.cmake index a2ee27b5d..f08aa1297 100644 --- a/cmake/godotcpp.cmake +++ b/cmake/godotcpp.cmake @@ -315,7 +315,7 @@ function(godotcpp_generate) godot_arch_name( ARCH_NAME ) # Transform options into generator expressions - set(HOT_RELOAD-UNSET "$") + set(HOT_RELOAD "$") set(DISABLE_EXCEPTIONS "$") @@ -337,7 +337,6 @@ function(godotcpp_generate) ### Define our godot-cpp library targets # Generator Expressions that rely on the target set(DEBUG_FEATURES "$>") - set(HOT_RELOAD "$>") # Suffix Generator Expression string( diff --git a/cmake/linux.cmake b/cmake/linux.cmake index 644f0814c..c782bce3f 100644 --- a/cmake/linux.cmake +++ b/cmake/linux.cmake @@ -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 "$") + set(STATIC_CPP "$,$>") target_compile_definitions(godot-cpp PUBLIC LINUX_ENABLED UNIX_ENABLED) diff --git a/tools/godotcpp.py b/tools/godotcpp.py index f9448df1e..25a8067ed 100644 --- a/tools/godotcpp.py +++ b/tools/godotcpp.py @@ -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), ) ) @@ -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"] diff --git a/tools/linux.py b/tools/linux.py index 8aae02c15..2975c68a6 100644 --- a/tools/linux.py +++ b/tools/linux.py @@ -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): @@ -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'"])