mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
ohos/android: Fix some compiler warnings (#34178)
* ohos: Remove unnecessary library links `ohos-sys` now correctly links all required libraries, so we don't need to specify them here again. We still specify `ace_napi.z`, since we use napi via `napi-ohos`, which currently does not add the required link. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Disable some unused functions on ohos/android - get_default_url() - parse_url_or_filename() - add_noto_fallback_families Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * ohos: Remove unneeded import Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This commit is contained in:
parent
219d3c9cd5
commit
4f6283d7fe
4 changed files with 23 additions and 10 deletions
|
@ -10,7 +10,6 @@ use std::{fs, io};
|
||||||
|
|
||||||
use base::text::{UnicodeBlock, UnicodeBlockMethod};
|
use base::text::{UnicodeBlock, UnicodeBlockMethod};
|
||||||
use log::{debug, error, warn};
|
use log::{debug, error, warn};
|
||||||
use malloc_size_of_derive::MallocSizeOf;
|
|
||||||
use style::values::computed::font::GenericFontFamily;
|
use style::values::computed::font::GenericFontFamily;
|
||||||
use style::values::computed::{
|
use style::values::computed::{
|
||||||
FontStretch as StyleFontStretch, FontStyle as StyleFontStyle, FontWeight as StyleFontWeight,
|
FontStretch as StyleFontStretch, FontStyle as StyleFontStyle, FontWeight as StyleFontWeight,
|
||||||
|
|
|
@ -2,9 +2,17 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
#[cfg(all(
|
||||||
|
any(target_os = "linux", target_os = "macos"),
|
||||||
|
not(target_os = "android"),
|
||||||
|
not(target_env = "ohos")
|
||||||
|
))]
|
||||||
use base::text::{UnicodeBlock, UnicodeBlockMethod};
|
use base::text::{UnicodeBlock, UnicodeBlockMethod};
|
||||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
#[cfg(all(
|
||||||
|
any(target_os = "linux", target_os = "macos"),
|
||||||
|
not(target_os = "android"),
|
||||||
|
not(target_env = "ohos")
|
||||||
|
))]
|
||||||
use unicode_script::Script;
|
use unicode_script::Script;
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
|
@ -15,7 +23,11 @@ pub use crate::platform::macos::{
|
||||||
};
|
};
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub use crate::platform::windows::{font, font_list, font_list::LocalFontIdentifier};
|
pub use crate::platform::windows::{font, font_list, font_list::LocalFontIdentifier};
|
||||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
#[cfg(all(
|
||||||
|
any(target_os = "linux", target_os = "macos"),
|
||||||
|
not(target_os = "android"),
|
||||||
|
not(target_env = "ohos")
|
||||||
|
))]
|
||||||
use crate::FallbackFontSelectionOptions;
|
use crate::FallbackFontSelectionOptions;
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
|
@ -34,7 +46,11 @@ mod windows {
|
||||||
pub mod font_list;
|
pub mod font_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
#[cfg(all(
|
||||||
|
any(target_os = "linux", target_os = "macos"),
|
||||||
|
not(target_os = "android"),
|
||||||
|
not(target_env = "ohos")
|
||||||
|
))]
|
||||||
pub(crate) fn add_noto_fallback_families(
|
pub(crate) fn add_noto_fallback_families(
|
||||||
options: FallbackFontSelectionOptions,
|
options: FallbackFontSelectionOptions,
|
||||||
families: &mut Vec<&'static str>,
|
families: &mut Vec<&'static str>,
|
||||||
|
|
|
@ -34,12 +34,8 @@ use super::servo_glue::ServoGlue;
|
||||||
mod resources;
|
mod resources;
|
||||||
mod simpleservo;
|
mod simpleservo;
|
||||||
|
|
||||||
// Todo: in the future these libraries should be added by Rust sys-crates
|
// Can be removed once <https://github.com/ohos-rs/ohos-rs/pull/105> is merged / released.
|
||||||
#[link(name = "ace_napi.z")]
|
#[link(name = "ace_napi.z")]
|
||||||
#[link(name = "ace_ndk.z")]
|
|
||||||
#[link(name = "hilog_ndk.z")]
|
|
||||||
#[link(name = "native_window")]
|
|
||||||
#[link(name = "clang_rt.builtins", kind = "static")]
|
|
||||||
extern "C" {}
|
extern "C" {}
|
||||||
|
|
||||||
#[napi(object)]
|
#[napi(object)]
|
||||||
|
|
|
@ -10,6 +10,7 @@ use servo::servo_config::pref;
|
||||||
use servo::servo_url::ServoUrl;
|
use servo::servo_url::ServoUrl;
|
||||||
use url::{self, Url};
|
use url::{self, Url};
|
||||||
|
|
||||||
|
#[cfg(not(any(target_os = "android", target_env = "ohos")))]
|
||||||
pub fn parse_url_or_filename(cwd: &Path, input: &str) -> Result<ServoUrl, ()> {
|
pub fn parse_url_or_filename(cwd: &Path, input: &str) -> Result<ServoUrl, ()> {
|
||||||
match ServoUrl::parse(input) {
|
match ServoUrl::parse(input) {
|
||||||
Ok(url) => Ok(url),
|
Ok(url) => Ok(url),
|
||||||
|
@ -20,6 +21,7 @@ pub fn parse_url_or_filename(cwd: &Path, input: &str) -> Result<ServoUrl, ()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(any(target_os = "android", target_env = "ohos")))]
|
||||||
pub fn get_default_url(
|
pub fn get_default_url(
|
||||||
url_opt: Option<&str>,
|
url_opt: Option<&str>,
|
||||||
cwd: impl AsRef<Path>,
|
cwd: impl AsRef<Path>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue