1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 00:28:48 -05:00

cmake: don't pass -fvisibility=hidden to clang-cl on Windows

When using clang-cl on windows -fvisibility=hidden is not an known
argument. Instead it behaves exactly like MSVC in this case. So let's
make sure we take that path.

In CMake clang-cl sets both CMAKE_C_COMPILER_ID=clang and MSVC get's
defined since clang-cl is basically a MSVC emulator. So guarding like we
do in this patch seems logical.

Reviewed-by: Jakub Zakrzewski
Closes #6194
This commit is contained in:
Tobias Hieta 2020-11-10 10:30:29 +01:00 committed by Daniel Stenberg
parent c49d205ae0
commit fd5f35ef0b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -27,7 +27,7 @@ mark_as_advanced(CURL_HIDDEN_SYMBOLS)
if(CURL_HIDDEN_SYMBOLS)
set(SUPPORTS_SYMBOL_HIDING FALSE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
set(SUPPORTS_SYMBOL_HIDING TRUE)
set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))")
set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")