From b7f58511cf050b8976445694446c695c9d230b8b Mon Sep 17 00:00:00 2001 From: Nils Gladitz Date: Fri, 7 Feb 2014 11:50:08 +0100 Subject: [PATCH] Visibility: the Intel compiler does not support -fvisibility on windows --- Modules/Compiler/Intel-C.cmake | 4 ---- Modules/Compiler/Intel-CXX.cmake | 4 ---- Modules/Platform/Darwin-icc.cmake | 6 ++++++ Modules/Platform/Linux-Intel.cmake | 4 ++++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 7d98f03988..1d651e368d 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -8,9 +8,5 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") set(CMAKE_DEPFILE_FLAGS_C "-MMD -MT -MF ") -if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) - set(CMAKE_C_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") -endif() - set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") set(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 36a838da8a..020e862c69 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -8,9 +8,5 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") set(CMAKE_DEPFILE_FLAGS_CXX "-MMD -MT -MF ") -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0) - set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") -endif() - set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake index 0fab9a12ec..c7e31c08c1 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -75,6 +75,12 @@ if(XCODE) set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX) endif() +if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) + set(CMAKE_C_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") + set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") +endif() + + set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different ") set(CMAKE_C_CREATE_SHARED_LIBRARY diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index 2394f1050d..20fddb4229 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -47,4 +47,8 @@ macro(__linux_compiler_intel lang) "${XIAR} cr " "${XIAR} -s ") endif() + + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0) + set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") + endif() endmacro()