瀏覽代碼

Test for deprecated attribute before declspec.

The attribute seems more common, and some compilers seem to silently
ignore the declspec.
Stephen Kelly 14 年之前
父節點
當前提交
aed84517c9
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      Modules/GenerateExportHeader.cmake

+ 4 - 4
Modules/GenerateExportHeader.cmake

@@ -158,11 +158,11 @@ macro(_test_compiler_hidden_visibility)
 endmacro()
 
 macro(_test_compiler_has_deprecated)
-  _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED_DECLSPEC)
-  if(COMPILER_HAS_DEPRECATED_DECLSPEC)
-    set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_DECLSPEC}" CACHE INTERNAL "Compiler support for a deprecated attribute")
+  _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("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED)
+    _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED)
   endif()
 endmacro()