[fontconfig] use __attribute__((visibility("default"))) for exporting symbols on macOS (#5689)

* use __attribute__((visibility("default"))) for exporting symbols on macOS

* [fontconfig] Bump CONTROL version
This commit is contained in:
angelmixu 2019-03-15 19:12:55 +01:00 committed by Victor Romero
parent ee957d9170
commit e740b5717c
3 changed files with 11 additions and 3 deletions

View File

@ -37,7 +37,11 @@ add_library(fontconfig
src/fcxml.c
src/ftglue.c)
set_target_properties(fontconfig PROPERTIES DEFINE_SYMBOL "FcPublic=__declspec(dllexport)")
if(WIN32)
set_target_properties(fontconfig PROPERTIES DEFINE_SYMBOL "FcPublic=__declspec(dllexport)")
else()
set_target_properties(fontconfig PROPERTIES DEFINE_SYMBOL "FcPublic=__attribute__((visibility(\"default\")))")
endif()
target_include_directories(fontconfig PRIVATE .
${FC_INCLUDE_DIR}/alias

View File

@ -1,4 +1,4 @@
Source: fontconfig
Version: 2.12.4-7
Version: 2.12.4-8
Description: Library for configuring and customizing font access.
Build-Depends: freetype, expat, libiconv, dirent

View File

@ -36,7 +36,11 @@ vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
foreach(HEADER fcfreetype.h fontconfig.h)
file(READ ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} FC_HEADER)
string(REPLACE "#define FcPublic" "#define FcPublic __declspec(dllimport)" FC_HEADER "${FC_HEADER}")
if(WIN32)
string(REPLACE "#define FcPublic" "#define FcPublic __declspec(dllimport)" FC_HEADER "${FC_HEADER}")
else()
string(REPLACE "#define FcPublic" "#define FcPublic __attribute__((visibility(\"default\")))" FC_HEADER "${FC_HEADER}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} "${FC_HEADER}")
endforeach()
endif()