Skip to content

Commit

Permalink
Do not show eCAL deprecation warnings, when building ecal_core and ec…
Browse files Browse the repository at this point in the history
…al_core_c
  • Loading branch information
KerstinKeller committed Oct 26, 2023
1 parent 171ecae commit 0d96038
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
9 changes: 7 additions & 2 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ target_compile_definitions(${PROJECT_NAME}_c
PUBLIC
ASIO_STANDALONE
ASIO_DISABLE_VISIBILITY
PRIVATE eCAL_EXPORTS)
PRIVATE
eCAL_EXPORTS
ECAL_NO_DEPRECATION_WARNINGS
)

target_compile_definitions(${PROJECT_NAME}
PUBLIC
Expand All @@ -449,7 +452,9 @@ target_compile_definitions(${PROJECT_NAME}
eCAL_EXPORTS
$<$<BOOL:${ECAL_HAS_CLOCKLOCK_MUTEX}>:ECAL_HAS_CLOCKLOCK_MUTEX>
$<$<BOOL:${ECAL_HAS_ROBUST_MUTEX}>:ECAL_HAS_ROBUST_MUTEX>
$<$<BOOL:${ECAL_USE_CLOCKLOCK_MUTEX}>:ECAL_USE_CLOCKLOCK_MUTEX>)
$<$<BOOL:${ECAL_USE_CLOCKLOCK_MUTEX}>:ECAL_USE_CLOCKLOCK_MUTEX>
ECAL_NO_DEPRECATION_WARNINGS
)

if(ECAL_NPCAP_SUPPORT)
target_compile_definitions(${PROJECT_NAME}
Expand Down
13 changes: 8 additions & 5 deletions ecal/core/include/ecal/ecal_deprecate.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,35 @@

#include <ecal/ecal_defs.h>

#if ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 4, 0)
//uncomment this line if you do want to get deprecation warnings inside eCAL core
//#undef ECAL_NO_DEPRECATION_WARNINGS

#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 4, 0)
#define ECAL_DEPRECATE_SINCE_5_4(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.4.0
#else
#define ECAL_DEPRECATE_SINCE_5_4(__message__) //!< Deprecate the following function with eCAL Version 5.4.0
#endif


#if ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 10, 0)
#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 10, 0)
#define ECAL_DEPRECATE_SINCE_5_10(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.10.0
#else
#define ECAL_DEPRECATE_SINCE_5_10(__message__) //!< Deprecate the following function with eCAL Version 5.10.0
#endif

#if ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 11, 0)
#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 11, 0)
#define ECAL_DEPRECATE_SINCE_5_11(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.11.0
#else
#define ECAL_DEPRECATE_SINCE_5_11(__message__) //!< Deprecate the following function with eCAL Version 5.11.0
#endif

#if ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 12, 0)
#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 12, 0)
#define ECAL_DEPRECATE_SINCE_5_12(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.12.0
#else
#define ECAL_DEPRECATE_SINCE_5_12(__message__) //!< Deprecate the following function with eCAL Version 5.12.0
#endif

#if ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 13, 0)
#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 13, 0)
#define ECAL_DEPRECATE_SINCE_5_13(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.13.0
#else
#define ECAL_DEPRECATE_SINCE_5_13(__message__) //!< Deprecate the following function with eCAL Version 5.13.0
Expand Down

0 comments on commit 0d96038

Please sign in to comment.