summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2011-08-11 08:28:50 (GMT)
committerStephen Kelly <steveire@gmail.com>2011-08-11 08:28:50 (GMT)
commit399f415b1558397e51502914ae36b6d055668eeb (patch)
treec8573251edfce18d083c7e30d1940bdf48b00153
parent1c6b41bee7fb1e2b85be4ab3497889ab72089f69 (diff)
downloadCMake-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.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)