GDExtension C++ example using CMake with hot reloading enabled.
- Clone repository and enter it.
git clone https://github.com/Drahiri/gde_example_cmake_reload.git
cd gde_example_cmake_reload
- Initialize godot-cpp submodule.
cd godot-cpp
git submodule update --init
- Add following lines to
godot-cpp/CMakeLists.txt
at line129
to match this PR.
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -fno-gnu-unique")
endif()
- Leave
godot-cpp
folder.
cd ..
- Create
build
folder, configure and build project.x
is number of jobs.
mkdir build
cd build
cmake .. -GNinja
ninja -jx
-
Import and open demo project in Godot.
-
Make changes in
gdexample.cpp
file. Commenting out_bind_methods()
content is good idea. -
Rebuild library.
-
If you commented out
_bind_methods()
content, in editors' Inspector propertyAmplitude
should disappear.