From 98a894f0ebc0cfdfd0f9236e174f501d98cfd6bc Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Mon, 4 Feb 2019 15:12:17 +0100
Subject: [PATCH] Jenkins CI: option for selective trace file build

adds an option to the Makefile to allow selected platform build
with trace option enabled when run in Jenkins
---
 Makefile | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Makefile b/Makefile
index d737cd856..c729b17b2 100644
--- a/Makefile
+++ b/Makefile
@@ -43,6 +43,8 @@ else
   UNAME_S := $(shell uname -s)
   BUILD_CMD := $(BUILD_SCRIPT)
   ifeq ($(UNAME_S),Linux)
+    # for Jenkins: run trace build only on Linux
+    TRACEBUILD := TRUE
   endif
   ifeq ($(UNAME_S),Darwin)
     # MAC
@@ -96,6 +98,14 @@ ifneq ($(static),)
 CONFIG_OPTIONS += -DBUILD_STATIC=$(static)
 endif
 
+# don't build, if TRACEBUILD option is not set (for selective Jenkins build)
+ifeq ($(TRACEBUILD),TRUE)
+CONFIG_OPTIONS += -DSET_ENABLE_TRACING=ON -DENABLE_TRACING=1
+TRACE_BUILD_CMD = $(BUILD_CMD)
+else
+TRACE_BUILD_CMD = echo TRACE BUILD DISABLED 
+endif
+
 BUILD_OPTIONS := $(CONFIG_OPTIONS) -b
 
 debug:
@@ -127,6 +137,10 @@ clean-p:
 configure:
 	$(BUILD_CMD) $(CONFIG_OPTIONS) $(CMAKE_OPTIONS) variant=debug,release,relwithdebinfo
 
+tracebuild:
+	# option for automated jenkins build
+	$(TRACE_BUILD_CMD) $(BUILD_JOBS) $(BUILD_OPTIONS) $(CMAKE_OPTIONS) variant=debug
+
 #
 # project specific targets
 #
-- 
GitLab