From 399f415b1558397e51502914ae36b6d055668eeb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 11 Aug 2011 10:28:50 +0200 Subject: Only set the deprecated attribute if hidden visibilty is enabled. This is what is tested in the unit test. If it makes sense, another option can be added later. --- Modules/GenerateExportHeader.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 9dd8f4a..0b93941 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -155,7 +155,9 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY) set(DEFINE_DEPRECATED "__declspec(deprecated)") endif() else() - set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))") + if(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY) + set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))") + endif() endif() get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE) -- cgit v0.12