summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-09-10 15:47:53 -0500
committerGitHub <noreply@github.com>2024-09-10 15:47:53 -0500
commitf4d3817d99e0ebb9687c8597cab29d4989e09a13 (patch)
treeef80fdcc1de9b131a3afc26037706e4bf2cc3b91
parentd47758910428242169ebe59329b449edf16036e0 (diff)
parent05571971cc4b57f34c1fce180c2df20750c5bc90 (diff)
downloadredot-cpp-f4d3817d99e0ebb9687c8597cab29d4989e09a13.tar.gz
Merge pull request #1548 from ytnuf/hot_reload
Add hot reload support when building with GCC and CMake
-rw-r--r--CMakeLists.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9609061..af62675 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,10 +124,6 @@ else()
endif()
endif()
-if (GODOT_ENABLE_HOT_RELOAD)
- set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -D HOT_RELOAD_ENABLED")
-endif()
-
# Generate source from the bindings file
find_package(Python3 3.4 REQUIRED) # pathlib should be present
if(GENERATE_TEMPLATE_GET_NODE)
@@ -170,6 +166,11 @@ target_compile_features(${PROJECT_NAME}
cxx_std_17
)
+if(GODOT_ENABLE_HOT_RELOAD)
+ target_compile_definitions(${PROJECT_NAME} PUBLIC HOT_RELOAD_ENABLED)
+ target_compile_options(${PROJECT_NAME} PUBLIC $<${compiler_is_gnu}:-fno-gnu-unique>)
+endif()
+
target_compile_definitions(${PROJECT_NAME} PUBLIC
$<$<CONFIG:Debug>:
DEBUG_ENABLED