diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml index 8a0600f35e4..ea2feb49b5e 100644 --- a/components/config/Cargo.toml +++ b/components/config/Cargo.toml @@ -25,5 +25,5 @@ servo_url = { path = "../url" } style_config = { workspace = true } url = { workspace = true } -[target.'cfg(not(target_os = "android"))'.dependencies] +[target.'cfg(not(any(target_os = "android", target_env = "ohos")))'.dependencies] dirs = "5.0" diff --git a/components/config/basedir.rs b/components/config/basedir.rs index a7e5226dea9..2fa70408a34 100644 --- a/components/config/basedir.rs +++ b/components/config/basedir.rs @@ -12,7 +12,8 @@ use std::path::PathBuf; unix, not(target_os = "macos"), not(target_os = "ios"), - not(target_os = "android") + not(target_os = "android"), + not(target_env = "ohos") ))] pub fn default_config_dir() -> Option { let mut config_dir = ::dirs::config_dir().unwrap(); @@ -21,7 +22,7 @@ pub fn default_config_dir() -> Option { Some(config_dir) } -#[cfg(target_os = "android")] +#[cfg(any(target_os = "android", target_env = "ohos"))] pub fn default_config_dir() -> Option { None }