diff options
author | Stephen Kelly <steveire@gmail.com> | 2011-08-11 08:28:50 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2011-08-11 08:28:50 (GMT) |
commit | 399f415b1558397e51502914ae36b6d055668eeb (patch) | |
tree | c8573251edfce18d083c7e30d1940bdf48b00153 | |
parent | 1c6b41bee7fb1e2b85be4ab3497889ab72089f69 (diff) | |
download | CMake-399f415b1558397e51502914ae36b6d055668eeb.zip CMake-399f415b1558397e51502914ae36b6d055668eeb.tar.gz CMake-399f415b1558397e51502914ae36b6d055668eeb.tar.bz2 |
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.
-rw-r--r-- | Modules/GenerateExportHeader.cmake | 4 |
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) |