Added hot reload support to CMakeLists.txt

pull/1330/head
Joakim Stien 2023-12-09 15:13:32 +01:00
parent 48afa82f29
commit 31179ee47c
1 changed files with 5 additions and 0 deletions

View File

@ -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(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_SYSTEM_HEADERS "Expose headers as SYSTEM." ON)
option(GODOT_CPP_WARNING_AS_ERROR "Treat warnings as errors" OFF) 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 # Add path to modules
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" ) list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" )
@ -116,6 +117,10 @@ else()
endif() endif()
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 # Generate source from the bindings file
find_package(Python3 3.4 REQUIRED) # pathlib should be present find_package(Python3 3.4 REQUIRED) # pathlib should be present
if(GENERATE_TEMPLATE_GET_NODE) if(GENERATE_TEMPLATE_GET_NODE)