From bf5269dfdd94d63d72eb7725f1d3ea3d270d034d Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Fri, 7 May 2021 04:07:29 +0200 Subject: Order macro for attribute for symbol export before that for deprecated The symbol export/visibility attribute is not standardized so far and needs to be set by language extension attribute declaration at least with clang & MSVC, who both support that when it appears before the standard attribute declaration. NO_CHANGELOG --- modules/ECMGenerateExportHeader.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/ECMGenerateExportHeader.cmake b/modules/ECMGenerateExportHeader.cmake index f6646899..7cd1418e 100644 --- a/modules/ECMGenerateExportHeader.cmake +++ b/modules/ECMGenerateExportHeader.cmake @@ -216,16 +216,18 @@ this, using the generated macros ``FOO_ENABLE_DEPRECATED_SINCE`` and /** * @deprecated Since 5.0 */ + FOO_EXPORT FOO_DEPRECATED_VERSION(5, 0, "Use doFoo2()") - FOO_EXPORT void doFoo(); + void doFoo(); #endif #if FOO_ENABLE_DEPRECATED_SINCE(5, 12) /** * @deprecated Since 5.12 */ + FOO_EXPORT FOO_DEPRECATED_VERSION(5, 12, "Use doBar2()") - FOO_EXPORT void doBar(); + void doBar(); #endif Projects linking against the "Foo" library can control which part of its @@ -283,16 +285,18 @@ uses the generated macro ``FOO_BUILD_DEPRECATED_SINCE``, like this: /** * @deprecated Since 5.0 */ + FOO_EXPORT FOO_DEPRECATED_VERSION(5, 0, "Use doFoo2()") - FOO_EXPORT void doFoo(); + void doFoo(); #endif #if FOO_ENABLE_DEPRECATED_SINCE(5, 12) /** * @deprecated Since 5.12 */ + FOO_EXPORT FOO_DEPRECATED_VERSION(5, 12, "Use doBar2()") - FOO_EXPORT void doBar(); + void doBar(); #endif class FOO_EXPORT Foo { -- cgit v1.2.1