windows exports: use dllexport attribute, instead of visibility.

With older toolchains, at the least, visibility attributes don't
work and all symbols are exported along with lots of unsupported
warnings.

Change-Id: I6ffe220b7589a6bda00f42c17ead35592de7cc5a
This commit is contained in:
Ozkan Sezer
2024-03-06 01:11:55 +03:00
parent 45f995a37e
commit 8487860a8c
4 changed files with 14 additions and 15 deletions

View File

@ -135,7 +135,7 @@ if(WEBP_UNICODE)
add_definitions(-DUNICODE -D_UNICODE)
endif()
if(MSVC AND BUILD_SHARED_LIBS)
if(WIN32 AND BUILD_SHARED_LIBS)
add_definitions(-DWEBP_DLL)
endif()
@ -163,7 +163,9 @@ if(MSVC)
set(CMAKE_STATIC_LIBRARY_PREFIX "${webp_libname_prefix}")
endif()
if(NOT WIN32)
set(CMAKE_C_VISIBILITY_PRESET hidden)
endif()
if(WEBP_ENABLE_WUNUSED_RESULT)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21.0)