From 403246bfbb6eba2569f160ec46d446fc3de5b79d Mon Sep 17 00:00:00 2001 From: Saya Sugiura Date: Wed, 28 Jul 2021 10:39:38 +0900 Subject: header: Adapt to DLT_DISABLE_MACRO If dlt.h is included in external application, it needed to include -DDLT_DISABLE_MACRO to make ifdef switch work. This commit adds DLT_DISABLE_MACRO in dlt_user.h so that no additional definition is needed in application. Signed-off-by: Saya Sugiura --- include/dlt/CMakeLists.txt | 4 ++++ include/dlt/dlt_user.h.in | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dlt/CMakeLists.txt b/include/dlt/CMakeLists.txt index 9362821..ae05cc3 100644 --- a/include/dlt/CMakeLists.txt +++ b/include/dlt/CMakeLists.txt @@ -13,6 +13,10 @@ # For further information see http://www.genivi.org/. ####### +if(WITH_DLT_DISABLE_MACRO) + set(DLT_DISABLE_MACRO 1) +endif() + configure_file(dlt_user.h.in dlt_user.h) set(HEADER_LIST dlt.h dlt_user_macros.h dlt_client.h dlt_protocol.h diff --git a/include/dlt/dlt_user.h.in b/include/dlt/dlt_user.h.in index 7a2d35e..2c42603 100644 --- a/include/dlt/dlt_user.h.in +++ b/include/dlt/dlt_user.h.in @@ -78,6 +78,8 @@ #cmakedefine DLT_NETWORK_TRACE_ENABLE #endif +#cmakedefine01 DLT_DISABLE_MACRO + #ifdef DLT_NETWORK_TRACE_ENABLE # include #else @@ -92,8 +94,10 @@ # endif # include "dlt_types.h" -# include "dlt_user_macros.h" # include "dlt_shm.h" +#if !DLT_DISABLE_MACRO +# include "dlt_user_macros.h" +#endif # ifdef __cplusplus extern "C" { -- cgit v1.2.1