summaryrefslogtreecommitdiff
path: root/cmake/utils/DebugTargets.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/utils/DebugTargets.cmake')
-rw-r--r--cmake/utils/DebugTargets.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/utils/DebugTargets.cmake b/cmake/utils/DebugTargets.cmake
new file mode 100644
index 00000000..78899213
--- /dev/null
+++ b/cmake/utils/DebugTargets.cmake
@@ -0,0 +1,16 @@
+# Utility functions for Ouroboros target configuration
+set(OUROBOROS_DEBUG_CONFIGS
+ Debug
+ DebugASan
+ DebugTSan
+ DebugLSan
+ DebugUSan
+ DebugAnalyzer
+)
+
+# Add CONFIG_OUROBOROS_DEBUG definition for debug build types
+function(ouroboros_target_debug_definitions target)
+ list(JOIN OUROBOROS_DEBUG_CONFIGS "," _configs)
+ target_compile_definitions(${target} PRIVATE
+ "$<$<CONFIG:${_configs}>:CONFIG_OUROBOROS_DEBUG>")
+endfunction()