Bug 1518937 - Make dynamic linking for freetype symbols configurable. r=lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D16108

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Josh Matthews 2019-01-11 17:01:52 +00:00
Родитель 32abb9ff27
Коммит 4676fc4f15
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -17,6 +17,7 @@ replay = ["webrender_api/deserialize", "ron", "serde"]
debug_renderer = []
pathfinder = ["pathfinder_font_renderer", "pathfinder_gfx_utils", "pathfinder_partitioner", "pathfinder_path_utils"]
serialize_program = ["serde", "webrender_build/serialize_program"]
no_static_freetype = []
[build-dependencies]
webrender_build = { version = "0.0.1", path = "../webrender_build" }

Просмотреть файл

@ -25,7 +25,7 @@ use glyph_rasterizer::{GlyphRasterError, GlyphRasterResult, RasterizedGlyph};
#[cfg(feature = "pathfinder")]
use glyph_rasterizer::NativeFontHandleWrapper;
use internal_types::{FastHashMap, ResourceCacheError};
#[cfg(not(target_os = "android"))]
#[cfg(any(not(target_os = "android"), feature = "no_static_freetype"))]
use libc::{dlsym, RTLD_DEFAULT};
use libc::free;
#[cfg(feature = "pathfinder")]
@ -77,7 +77,7 @@ pub fn unimplemented(error: FT_Error) -> bool {
}
// Use dlsym to check for symbols. If not available. just return an unimplemented error.
#[cfg(not(target_os = "android"))]
#[cfg(any(not(target_os = "android"), feature = "no_static_freetype"))]
macro_rules! ft_dyn_fn {
($func_name:ident($($arg_name:ident:$arg_type:ty),*) -> FT_Error) => {
#[allow(non_snake_case)]
@ -100,7 +100,7 @@ macro_rules! ft_dyn_fn {
}
// On Android, just statically link in the symbols...
#[cfg(target_os = "android")]
#[cfg(all(target_os = "android", not(feature = "no_static_freetype")))]
macro_rules! ft_dyn_fn {
($($proto:tt)+) => { extern "C" { fn $($proto)+; } }
}