summaryrefslogtreecommitdiff
path: root/cmake/utils
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/utils')
-rw-r--r--cmake/utils/DisableTestLogging.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/utils/DisableTestLogging.cmake b/cmake/utils/DisableTestLogging.cmake
new file mode 100644
index 00000000..730b0bc0
--- /dev/null
+++ b/cmake/utils/DisableTestLogging.cmake
@@ -0,0 +1,12 @@
+set(DISABLE_TESTS_LOGGING TRUE CACHE BOOL "Disable Ouroboros log output in tests")
+if (DISABLE_TESTS_LOGGING)
+ message(STATUS "Ouroboros logging in test output disabled")
+else ()
+ message(STATUS "Ouroboros logging in test output enabled")
+endif ()
+
+macro(disable_test_logging_for_target target)
+ if (DISABLE_TESTS_LOGGING)
+ target_compile_definitions(${target} PRIVATE OUROBOROS_DISABLE_LOGGING)
+ endif ()
+endmacro()