From fd5f35ef0b5635fae2bc39335d6339c96b843b33 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Tue, 10 Nov 2020 10:30:29 +0100 Subject: [PATCH] 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 --- CMake/CurlSymbolHiding.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/CurlSymbolHiding.cmake b/CMake/CurlSymbolHiding.cmake index f8500a845..e99ea6f64 100644 --- a/CMake/CurlSymbolHiding.cmake +++ b/CMake/CurlSymbolHiding.cmake @@ -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")