# Copyright (C) 2024 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[package]
name = "preload_native_rlib"
version = "0.1.0"
edition = "2021"

[features]
default = [
    "netstack",
    "ohos",
]

ohos = [
    "cxx",
    "ffrt_rs",
    "cache_core/ohos",
    "request_utils/ohos",
]

netstack = [
    "netstack_rs",
]
ylong = [
    "ylong_http_client",
    "ylong_runtime",
]

[dependencies]
cxx = { version = "1.0.115", optional = true }

cache_core = { path = "../cache_core" }

ffrt_rs = { path = "../../../common/ffrt_rs", optional = true }
request_utils = { path = "../../../common/utils" }
netstack_rs = { path = "../../../common/netstack_rs", optional = true }

ylong_http_client = { git = "https://gitcode.com/openharmony/commonlibrary_rust_ylong_http", features = [
    "async",
    "c_openssl_3_0",
    "http1_1",
    "ylong_base",
], optional = true }
ylong_runtime = { git = "https://gitcode.com/openharmony/commonlibrary_rust_ylong_runtime", features = ["full"], optional = true }

[dev-dependencies]
env_logger = "0.11.3"
criterion = { version = "0.4", features = ["html_reports"] }

[profile.release]
opt-level = "z"
codegen-units = 1