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.txtat line129to match this PR.
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -fno-gnu-unique")
endif()- Leave
godot-cppfolder.
cd ..
- Create
buildfolder, configure and build project.xis number of jobs.
mkdir build
cd build
cmake .. -GNinja
ninja -jx
-
Import and open demo project in Godot.
-
Make changes in
gdexample.cppfile. Commenting out_bind_methods()content is good idea. -
Rebuild library.
-
If you commented out
_bind_methods()content, in editors' Inspector propertyAmplitudeshould disappear.