diff --git a/vendor/BUILD.bazel b/vendor/BUILD.bazel index 7744c326d..642c565f9 100644 --- a/vendor/BUILD.bazel +++ b/vendor/BUILD.bazel @@ -722,6 +722,13 @@ cc_library( # "HB_NO_WIN1256", "HB_TINY", ], + # Keep bundled HarfBuzz symbols private so they do not interpose symbols from + # app dependencies. See https://github.com/maplibre/maplibre-native/issues/3777. + copts = select({ + "@platforms//os:ios": ["-fvisibility=hidden"], + "@platforms//os:macos": ["-fvisibility=hidden"], + "//conditions:default": [], + }), includes = [ "freetype/include", "harfbuzz/src", diff --git a/vendor/harfbuzz.cmake b/vendor/harfbuzz.cmake index b1a1866c3..de94370f6 100644 --- a/vendor/harfbuzz.cmake +++ b/vendor/harfbuzz.cmake @@ -15,6 +15,12 @@ if (MLN_TEXT_SHAPING_HARFBUZZ) target_include_directories(mbgl-harfbuzz PRIVATE ${CMAKE_CURRENT_LIST_DIR}/freetype/include) target_compile_definitions(mbgl-harfbuzz PRIVATE -DHAVE_FREETYPE) + if(APPLE) + # Keep bundled HarfBuzz symbols private so they do not interpose symbols from + # app dependencies. See https://github.com/maplibre/maplibre-native/issues/3777. + target_compile_options(mbgl-harfbuzz PRIVATE -fvisibility=hidden) + endif() + set_target_properties( mbgl-harfbuzz PROPERTIES