Add the COMPILER_HAS_DEPRECATED only if it has a declspec variant

_check_cxx_compiler_attribute does it in the alternative.
This commit is contained in:
Stephen Kelly 2011-08-12 00:21:13 +02:00
parent 78a6e1c122
commit df4615e338
1 changed files with 1 additions and 2 deletions

View File

@ -160,11 +160,10 @@ endmacro()
macro(_test_compiler_has_deprecated) macro(_test_compiler_has_deprecated)
_check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED_DECLSPEC) _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED_DECLSPEC)
if(COMPILER_HAS_DEPRECATED_DECLSPEC) if(COMPILER_HAS_DEPRECATED_DECLSPEC)
set(COMPILER_HAS_DEPRECATED ${COMPILER_HAS_DEPRECATED_DECLSPEC}) set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_DECLSPEC}" CACHE INTERNAL "Compiler support for a deprecated attribute")
else() else()
_check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED) _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED)
endif() endif()
set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED}" CACHE INTERNAL "Compiler support for a deprecated attribute")
endmacro() endmacro()
set(myDir ${CMAKE_CURRENT_LIST_DIR}) set(myDir ${CMAKE_CURRENT_LIST_DIR})