Fail if trace.h is included without TRACE_LEVEL
To avoid hiding errors, fail if a component includes trace.h,
but TRACE_LEVEL is not set.
Change-Id: Ia30e42c745af5b521194ffd32965a930fc490b66
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
diff --git a/components/common/trace/include/trace.h b/components/common/trace/include/trace.h
index 4395e41..1495374 100644
--- a/components/common/trace/include/trace.h
+++ b/components/common/trace/include/trace.h
@@ -20,7 +20,7 @@
#define TRACE_LEVEL_DEBUG (3)
#ifndef TRACE_LEVEL
-#define TRACE_LEVEL TRACE_LEVEL_ERROR
+#error "Trace level is not defined!"
#endif /* TRACE_LEVEL */
/**
diff --git a/deployments/ts-service-test/ts-service-test.cmake b/deployments/ts-service-test/ts-service-test.cmake
index 925cedd..6c3b3fe 100644
--- a/deployments/ts-service-test/ts-service-test.cmake
+++ b/deployments/ts-service-test/ts-service-test.cmake
@@ -76,6 +76,15 @@
)
#-------------------------------------------------------------------------------
+# Component configurations
+#
+#-------------------------------------------------------------------------------
+target_compile_definitions(ts-service-test PRIVATE
+ "TRACE_PREFIX=\"TEST\""
+ "TRACE_LEVEL=0"
+)
+
+#-------------------------------------------------------------------------------
# Components used from external projects
#
#-------------------------------------------------------------------------------