summaryrefslogtreecommitdiffstats
path: root/Modules/GenerateExportHeader.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/GenerateExportHeader.cmake')
-rw-r--r--Modules/GenerateExportHeader.cmake4
1 files changed, 3 insertions, 1 deletions
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)