Skip to content

Commit f4d3817

Browse files
authored
Merge pull request godotengine#1548 from ytnuf/hot_reload
Add hot reload support when building with GCC and CMake
2 parents d477589 + 0557197 commit f4d3817

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@ else()
124124
endif()
125125
endif()
126126

127-
if (GODOT_ENABLE_HOT_RELOAD)
128-
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -D HOT_RELOAD_ENABLED")
129-
endif()
130-
131127
# Generate source from the bindings file
132128
find_package(Python3 3.4 REQUIRED) # pathlib should be present
133129
if(GENERATE_TEMPLATE_GET_NODE)
@@ -170,6 +166,11 @@ target_compile_features(${PROJECT_NAME}
170166
cxx_std_17
171167
)
172168

169+
if(GODOT_ENABLE_HOT_RELOAD)
170+
target_compile_definitions(${PROJECT_NAME} PUBLIC HOT_RELOAD_ENABLED)
171+
target_compile_options(${PROJECT_NAME} PUBLIC $<${compiler_is_gnu}:-fno-gnu-unique>)
172+
endif()
173+
173174
target_compile_definitions(${PROJECT_NAME} PUBLIC
174175
$<$<CONFIG:Debug>:
175176
DEBUG_ENABLED

0 commit comments

Comments
 (0)