diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2024-05-02 20:32:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-02 18:32:51 +0000 |
commit | ca064eaa518f407988751ce51834eff3d65b681c (patch) | |
tree | bec3b09c5992c7baffbde66f3ad01572b06d4f4f /components/allocator | |
parent | 9acf2182cd440d4080bb0eb2a2fbc7238d71e953 (diff) | |
download | servo-ca064eaa518f407988751ce51834eff3d65b681c.tar.gz servo-ca064eaa518f407988751ce51834eff3d65b681c.zip |
Add font-fallback on OpenHarmony and fix several compilation issues (#32141)
* Add OpenHarmony support for allocator / profile
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* gfx: Build harfbuzz from source on OHOS
Updates `freetype-sys` to v0.20.1, which includes a build
fix for OpenHarmony.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* gfx: Don't depend on fontconfig on OpenHarmony
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* gfx: Add ohos font fallback
Hardcode HarmonyOS_Sans_SC_Regular for Chinese
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* libservo: OHOS useragent, and explicitly opt out of sandboxing
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* libservo: Disable get_native_media_display_and_gl_context on ohos
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
---------
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Diffstat (limited to 'components/allocator')
-rw-r--r-- | components/allocator/Cargo.toml | 4 | ||||
-rw-r--r-- | components/allocator/lib.rs | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/components/allocator/Cargo.toml b/components/allocator/Cargo.toml index e6467da3737..3978241094d 100644 --- a/components/allocator/Cargo.toml +++ b/components/allocator/Cargo.toml @@ -12,7 +12,7 @@ path = "lib.rs" [features] use-system-allocator = ["libc"] -[target.'cfg(not(any(windows, target_os = "android")))'.dependencies] +[target.'cfg(not(any(windows, target_os = "android", target_env = "ohos")))'.dependencies] jemallocator = { workspace = true } jemalloc-sys = { workspace = true } libc = { workspace = true, optional = true } @@ -20,5 +20,5 @@ libc = { workspace = true, optional = true } [target.'cfg(windows)'.dependencies] winapi = { workspace = true, features = ["heapapi"] } -[target.'cfg(target_os = "android")'.dependencies] +[target.'cfg(any(target_os = "android", target_env = "ohos"))'.dependencies] libc = { workspace = true } diff --git a/components/allocator/lib.rs b/components/allocator/lib.rs index 20ac30e8022..a28916375df 100644 --- a/components/allocator/lib.rs +++ b/components/allocator/lib.rs @@ -9,7 +9,12 @@ static ALLOC: Allocator = Allocator; pub use crate::platform::*; -#[cfg(not(any(windows, target_os = "android", feature = "use-system-allocator")))] +#[cfg(not(any( + windows, + target_os = "android", + feature = "use-system-allocator", + target_env = "ohos" +)))] mod platform { use std::os::raw::c_void; @@ -32,7 +37,11 @@ mod platform { #[cfg(all( not(windows), - any(target_os = "android", feature = "use-system-allocator") + any( + target_os = "android", + feature = "use-system-allocator", + target_env = "ohos" + ) ))] mod platform { pub use std::alloc::System as Allocator; |