Add hot reload support when building with GCC and CMake#1548
Add hot reload support when building with GCC and CMake#1548dsnopek merged 1 commit intogodotengine:masterfrom
Conversation
dsnopek
left a comment
There was a problem hiding this comment.
Thanks!
Insofar as I understand cmake, this seems good. I only have the one note
CMakeLists.txt
Outdated
|
|
||
| if (GODOT_ENABLE_HOT_RELOAD) | ||
| set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -D HOT_RELOAD_ENABLED") | ||
| if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
There was a problem hiding this comment.
We have the compiler_is_gnu variable defined above. Could we use?
There was a problem hiding this comment.
Yep! But since it's a generator expression, it requires a slightly different approach (using the target_compile_options function instead).
That error is usually caused by not having |
@dsnopek Thanks for the reply! So, I added the changes in this commit, added "reloadable = true" to .gdextension and added the HOT_RELOAD_ENABLED But still have the same problem ... |
|
Finally made it work. Where |
|
@Drahiri well, I am bit confused I think. It was already working when running a scene. But I thought it would also update the scene in the editor. |
|
It's doing exactly that. After I updated CMake to match this pull request and updated mine CMake with that line. After rebuilding shared library, editor automatically updated without that message asking if hot reloading is enabled. |
|
@Drahiri I followed every step, It does not work for me, don't know why. I tried in two different systems, one with a 12800h and a 3050ti with fedora and another with 5800X3D and a 6950xt with gentoo ... |
|
@jpxaraujo I've added repo with working example. Also sorry to all staff if it's turning into spam (I feel like a little). |
Thank you for taking your time to create an example! Hopefully it can help other people. Will test it today or tomorrow. |
|
Now using the |
|
Cherry-picked for 4.2 in PR #1631 |
|
Cherry-picked for 4.3 in PR #1632 |


This is a small continuation to PR #1330 which adds hot reloading options for CMake
However when compiling with GCC, the option
-fno-gnu-uniquemust also be enabled to allow hot reloading.This is done in the SCons script:
godot-cpp/tools/linux.py
Line 20 in 9b98377