Simplify the compiler feature check

This commit is contained in:
Stephen Kelly 2011-08-10 10:32:58 +02:00
parent c7a937b712
commit 3574b75916
1 changed files with 4 additions and 6 deletions

View File

@ -142,14 +142,12 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
if(WIN32) if(WIN32)
set(DEFINE_EXPORT "__declspec(dllexport)") set(DEFINE_EXPORT "__declspec(dllexport)")
set(DEFINE_IMPORT "__declspec(dllimport)") set(DEFINE_IMPORT "__declspec(dllimport)")
elseif(CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES Intel AND UNIX)) elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
if(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))") set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))")
set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))") set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))")
set(DEFINE_NO_EXPORT "__attribute__((visibility(\"hidden\")))") set(DEFINE_NO_EXPORT "__attribute__((visibility(\"hidden\")))")
endif() endif()
endif() endif()
endif()
endmacro() endmacro()
macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)