Skip to content

Commit 0a078d9

Browse files
committed
PR comments — added doc, default 'ON' in Debug, 'OFF' in Release
1 parent 31179ee commit 0a078d9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# GODOT_GDEXTENSION_DIR: Path to the directory containing GDExtension interface header and API JSON file
66
# GODOT_CPP_SYSTEM_HEADERS Mark the header files as SYSTEM. This may be useful to supress warnings in projects including this one.
77
# GODOT_CPP_WARNING_AS_ERROR Treat any warnings as errors
8+
# GODOT_ENABLE_HOT_RELOAD Build with hot reload support. Defaults to YES for Debug-builds and NO for Release-builds.
89
# GODOT_CUSTOM_API_FILE: Path to a custom GDExtension API JSON file (takes precedence over `gdextension_dir`)
910
# FLOAT_PRECISION: Floating-point precision level ("single", "double")
1011
#
@@ -43,7 +44,6 @@ project(godot-cpp LANGUAGES CXX)
4344
option(GENERATE_TEMPLATE_GET_NODE "Generate a template version of the Node class's get_node." ON)
4445
option(GODOT_CPP_SYSTEM_HEADERS "Expose headers as SYSTEM." ON)
4546
option(GODOT_CPP_WARNING_AS_ERROR "Treat warnings as errors" OFF)
46-
option(GODOT_ENABLE_HOT_RELOAD "Build with hot reload support" OFF)
4747

4848
# Add path to modules
4949
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" )
@@ -58,6 +58,13 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "")
5858
set(CMAKE_BUILD_TYPE Debug)
5959
endif()
6060

61+
# Hot reload is enabled by default in Debug-builds
62+
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
63+
option(GODOT_ENABLE_HOT_RELOAD "Build with hot reload support" ON)
64+
else()
65+
option(GODOT_ENABLE_HOT_RELOAD "Build with hot reload support" OFF)
66+
endif()
67+
6168
if(NOT DEFINED BITS)
6269
set(BITS 32)
6370
if(CMAKE_SIZEOF_VOID_P EQUAL 8)

0 commit comments

Comments
 (0)