Skip to content

Commit a828ba3

Browse files
committed
override setting debug features
override setting debug features
1 parent a3f8921 commit a828ba3

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

cmake/godotcpp.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,8 @@ function(godotcpp_generate)
286286

287287
# Transform options into generator expressions
288288
set(HOT_RELOAD-UNSET "$<STREQUAL:${GODOTCPP_USE_HOT_RELOAD},>")
289-
289+
set(DEBUG_FEATURES-UNSET "$<STREQUAL:${GODOTCPP_DEBUG_FEATURES},>")
290290
set(DISABLE_EXCEPTIONS "$<BOOL:${GODOTCPP_DISABLE_EXCEPTIONS}>")
291-
292291
set(THREADS_ENABLED "$<BOOL:${GODOTCPP_THREADS}>")
293292

294293
# GODOTCPP_DEV_BUILD
@@ -309,8 +308,9 @@ function(godotcpp_generate)
309308
set(TARGET_NAME "godot-cpp.${TARGET_ALIAS}")
310309

311310
# Generator Expressions that rely on the target
312-
set(DEBUG_FEATURES "$<NOT:$<STREQUAL:${TARGET_ALIAS},template_release>>")
313-
set(HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},${DEBUG_FEATURES},$<BOOL:${GODOTCPP_USE_HOT_RELOAD}>>")
311+
set(TEMPLATE_RELEASE "$<STREQUAL:${TARGET_ALIAS},template_release>")
312+
set(DEBUG_FEATURES "$<IF:${DEBUG_FEATURES-UNSET},$<NOT:${TEMPLATE_RELEASE}>,$<BOOL:${GODOTCPP_DEBUG_FEATURES}>>")
313+
set(HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},$<NOT:${TEMPLATE_RELEASE}>,$<BOOL:${GODOTCPP_USE_HOT_RELOAD}>>")
314314

315315
# Suffix
316316
string(

tools/godotcpp.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,14 @@ def options(opts, env):
336336
)
337337
)
338338

339+
opts.Add(
340+
BoolVariable(
341+
key="debug_features",
342+
help="Enable the DEBUG_ENABLED and DEBUG_METHODS_ENABLED pre-processor defines.",
343+
default=env.get("debug_features", None),
344+
)
345+
)
346+
339347
opts.Add(
340348
BoolVariable(
341349
"disable_exceptions", "Force disabling exception handling code", default=env.get("disable_exceptions", True)
@@ -425,9 +433,10 @@ def generate(env):
425433

426434
# These defaults may be needed by platform tools
427435
env.use_hot_reload = env.get("use_hot_reload", env["target"] != "template_release")
436+
env.debug_features = env.get("debug_features", env["target"] != "template_release")
428437
env.editor_build = env["target"] == "editor"
429438
env.dev_build = env["dev_build"]
430-
env.debug_features = env["target"] in ["editor", "template_debug"]
439+
431440

432441
if env.dev_build:
433442
opt_level = "none"

0 commit comments

Comments
 (0)