Explorar o código

Borland can't do deprecated.

Stephen Kelly %!s(int64=14) %!d(string=hai) anos
pai
achega
2aeab4f973
Modificáronse 1 ficheiros con 8 adicións e 4 borrados
  1. 8 4
      Modules/GenerateExportHeader.cmake

+ 8 - 4
Modules/GenerateExportHeader.cmake

@@ -158,11 +158,15 @@ macro(_test_compiler_hidden_visibility)
 endmacro()
 
 macro(_test_compiler_has_deprecated)
-  _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED_ATTR)
-  if(COMPILER_HAS_DEPRECATED_ATTR)
-    set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}" CACHE INTERNAL "Compiler support for a deprecated attribute")
+  if("${CMAKE_CXX_COMPILER_ID}" MATCHES Borland)
+    set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL "Compiler support for a deprecated attribute")
   else()
-    _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED)
+    _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED_ATTR)
+    if(COMPILER_HAS_DEPRECATED_ATTR)
+      set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}" CACHE INTERNAL "Compiler support for a deprecated attribute")
+    else()
+      _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED)
+    endif()
   endif()
 endmacro()