Files
CMake/Modules/exportheader.cmake.in
T
Sergiu Deitsch 07dbb31e69 GenerateExportHeader: Support deprecation messages
Add message variants of the deprecation macros. With CXX_ATTRIBUTES,
prefer the standard [[deprecated]] as of C++14 and place it before the
export marker, since a C++11 attribute cannot follow __declspec.

Fixes: #20527
2026-10-31 13:54:22 +01:00

56 lines
1.3 KiB
CMake

#ifndef @INCLUDE_GUARD_NAME@
#define @INCLUDE_GUARD_NAME@
#ifdef @STATIC_DEFINE@
# define @EXPORT_MACRO_NAME@
# define @NO_EXPORT_MACRO_NAME@
#else
# ifndef @EXPORT_MACRO_NAME@
# ifdef @EXPORT_IMPORT_CONDITION@
/* We are building this library */
@EXPORT_DEFINITION@
# else
/* We are using this library */
@IMPORT_DEFINITION@
# endif
# endif
# ifndef @NO_EXPORT_MACRO_NAME@
@NO_EXPORT_DEFINITION@
# endif
#endif
#ifndef @DEPRECATED_MACRO_NAME@
@DEPRECATED_DEFINITION@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_MSG
@DEPRECATED_MSG_DEFINITION@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_EXPORT
# define @DEPRECATED_MACRO_NAME@_EXPORT @DEPRECATED_EXPORT@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_EXPORT_MSG
# define @DEPRECATED_MACRO_NAME@_EXPORT_MSG(msg) @DEPRECATED_EXPORT_MSG@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_NO_EXPORT
# define @DEPRECATED_MACRO_NAME@_NO_EXPORT @DEPRECATED_NO_EXPORT@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_NO_EXPORT_MSG
# define @DEPRECATED_MACRO_NAME@_NO_EXPORT_MSG(msg) @DEPRECATED_NO_EXPORT_MSG@
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if @DEFINE_NO_DEPRECATED@ /* DEFINE_NO_DEPRECATED */
# ifndef @NO_DEPRECATED_MACRO_NAME@
# define @NO_DEPRECATED_MACRO_NAME@
# endif
#endif
@CUSTOM_CONTENT@
#endif /* @INCLUDE_GUARD_NAME@ */