diff options
author | Friedrich W. H. Kossebau <kossebau@kde.org> | 2019-09-04 19:19:27 +0200 |
---|---|---|
committer | Friedrich W. H. Kossebau <kossebau@kde.org> | 2019-10-10 22:50:03 +0200 |
commit | 7b15c20dafc9133f93bbc65354ec3a36af168fd3 (patch) | |
tree | b61228f0bfb4cc4a50c70ccce67a69b273dc8d10 /tests/ECMGenerateExportHeaderTest/library/library.hpp | |
parent | f3f4893b5bd20a32dd48b147fdd243c3226a06f3 (diff) | |
download | extra-cmake-modules-7b15c20dafc9133f93bbc65354ec3a36af168fd3.tar.gz extra-cmake-modules-7b15c20dafc9133f93bbc65354ec3a36af168fd3.tar.bz2 |
Add ECMGenerateExportHeader, for improved handling of deprecated API
Summary:
Generates additional macros in the export header which can be used for
fine-grained disabling of warnings & visibility as well as excluding from
the build.
Reviewers: #frameworks, #build_system
Subscribers: chehrlic, dfaure, cgiboudeaux, kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D23789
Diffstat (limited to 'tests/ECMGenerateExportHeaderTest/library/library.hpp')
-rw-r--r-- | tests/ECMGenerateExportHeaderTest/library/library.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ECMGenerateExportHeaderTest/library/library.hpp b/tests/ECMGenerateExportHeaderTest/library/library.hpp new file mode 100644 index 00000000..2124bf8a --- /dev/null +++ b/tests/ECMGenerateExportHeaderTest/library/library.hpp @@ -0,0 +1,35 @@ +#include <library_export.h> + +enum Enum { +#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 0) + Enumerator_deprecatedAt2_0, +#endif + Enumerator_not_deprecated, +}; + +#if LIBRARY_ENABLE_DEPRECATED_SINCE(2, 0) +LIBRARY_DEPRECATED_VERSION(2, 0, "Deprecated at 2.0") +LIBRARY_EXPORT void function_deprecatedAt2_0(); +#endif + +#if LIBRARY_ENABLE_DEPRECATED_SINCE(2, 12) +LIBRARY_DEPRECATED_VERSION(2, 12, "Deprecated at 2.12") +LIBRARY_EXPORT void function_deprecatedAt2_12(); +#endif + +LIBRARY_EXPORT void function_not_deprecated(); + +class LIBRARY_EXPORT Class { +public: +#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 0) + LIBRARY_DEPRECATED_VERSION(2, 0, "Deprecated at 2.0") + virtual void method_deprecatedAt2_0(); +#endif + +#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 12) + LIBRARY_DEPRECATED_VERSION(2, 12, "Deprecated at 2.12") + virtual void method_deprecatedAt2_12(); +#endif + + virtual void method_not_deprecated(); +}; |