From 31179ee47c9b6a0d59dc09467b5c2619e6853427 Mon Sep 17 00:00:00 2001 From: Joakim Stien Date: Sat, 9 Dec 2023 15:13:32 +0100 Subject: [PATCH] Added hot reload support to CMakeLists.txt --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7151026..7ba159f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,7 @@ project(godot-cpp LANGUAGES CXX) option(GENERATE_TEMPLATE_GET_NODE "Generate a template version of the Node class's get_node." ON) option(GODOT_CPP_SYSTEM_HEADERS "Expose headers as SYSTEM." ON) option(GODOT_CPP_WARNING_AS_ERROR "Treat warnings as errors" OFF) +option(GODOT_ENABLE_HOT_RELOAD "Build with hot reload support" OFF) # Add path to modules list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" ) @@ -116,6 +117,10 @@ else() endif() endif() +if (GODOT_ENABLE_HOT_RELOAD) + set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -D HOT_RELOAD_ENABLED") +endif() + # Generate source from the bindings file find_package(Python3 3.4 REQUIRED) # pathlib should be present if(GENERATE_TEMPLATE_GET_NODE)