diff --git a/ports/fontconfig/CMakeLists.txt b/ports/fontconfig/CMakeLists.txt index 1c552468e6..1692e7856a 100644 --- a/ports/fontconfig/CMakeLists.txt +++ b/ports/fontconfig/CMakeLists.txt @@ -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 diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index 5366616598..5d75462c58 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -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 diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index fff6eb477b..4637f112cc 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -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()