Pārlūkot izejas kodu

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.
Stephen Kelly 14 gadi atpakaļ
vecāks
revīzija
399f415b15
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      Modules/GenerateExportHeader.cmake

+ 3 - 1
Modules/GenerateExportHeader.cmake

@@ -155,7 +155,9 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
       set(DEFINE_DEPRECATED "__declspec(deprecated)")
       set(DEFINE_DEPRECATED "__declspec(deprecated)")
     endif()
     endif()
   else()
   else()
-    set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))")
+    if(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
+      set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))")
+    endif()
   endif()
   endif()
 
 
   get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
   get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)