Test for deprecated attribute before declspec.

The attribute seems more common, and some compilers seem to silently
ignore the declspec.
This commit is contained in:
Stephen Kelly 2011-08-13 22:33:30 +02:00
parent c448b09ad3
commit aed84517c9
1 changed files with 4 additions and 4 deletions

View File

@ -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()