-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add hot reload support when building with GCC and CMake #1548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Insofar as I understand cmake, this seems good. I only have the one note
CMakeLists.txt
Outdated
@@ -126,6 +126,9 @@ endif() | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the compiler_is_gnu
variable defined above. Could we use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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-unique
must also be enabled to allow hot reloading.This is done in the SCons script:
godot-cpp/tools/linux.py
Line 20 in 9b98377