179a732c7Sopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
279a732c7Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
379a732c7Sopenharmony_ci# you may not use this file except in compliance with the License.
479a732c7Sopenharmony_ci# You may obtain a copy of the License at
579a732c7Sopenharmony_ci#
679a732c7Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
779a732c7Sopenharmony_ci#
879a732c7Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
979a732c7Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1079a732c7Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1179a732c7Sopenharmony_ci# See the License for the specific language governing permissions and
1279a732c7Sopenharmony_ci# limitations under the License.
1379a732c7Sopenharmony_ci
1479a732c7Sopenharmony_ciimport("//build/ohos.gni")
1579a732c7Sopenharmony_ciimport("//foundation/distributedhardware/device_manager/device_manager.gni")
1679a732c7Sopenharmony_ci
1779a732c7Sopenharmony_ciohos_shared_library("devicemanager") {
1879a732c7Sopenharmony_ci  branch_protector_ret = "pac_ret"
1979a732c7Sopenharmony_ci
2079a732c7Sopenharmony_ci  sanitize = {
2179a732c7Sopenharmony_ci    boundary_sanitize = true
2279a732c7Sopenharmony_ci    cfi = true
2379a732c7Sopenharmony_ci    cfi_cross_dso = true
2479a732c7Sopenharmony_ci    debug = false
2579a732c7Sopenharmony_ci    integer_overflow = true
2679a732c7Sopenharmony_ci    ubsan = true
2779a732c7Sopenharmony_ci  }
2879a732c7Sopenharmony_ci
2979a732c7Sopenharmony_ci  include_dirs = [
3079a732c7Sopenharmony_ci    "include",
3179a732c7Sopenharmony_ci    "${common_path}/include",
3279a732c7Sopenharmony_ci    "${common_path}/include/ipc",
3379a732c7Sopenharmony_ci    "${innerkits_path}/native_cpp/include",
3479a732c7Sopenharmony_ci    "${innerkits_path}/native_cpp/include/ipc",
3579a732c7Sopenharmony_ci    "${innerkits_path}/native_cpp/include/ipc/standard",
3679a732c7Sopenharmony_ci  ]
3779a732c7Sopenharmony_ci
3879a732c7Sopenharmony_ci  sources = [
3979a732c7Sopenharmony_ci    "${common_path}/src/dm_error_message.cpp",
4079a732c7Sopenharmony_ci    "src/dm_native_event.cpp",
4179a732c7Sopenharmony_ci    "src/native_devicemanager_js.cpp",
4279a732c7Sopenharmony_ci  ]
4379a732c7Sopenharmony_ci
4479a732c7Sopenharmony_ci  deps = [ "${innerkits_path}/native_cpp:devicemanagersdk" ]
4579a732c7Sopenharmony_ci
4679a732c7Sopenharmony_ci  defines = [
4779a732c7Sopenharmony_ci    "HI_LOG_ENABLE",
4879a732c7Sopenharmony_ci    "DH_LOG_TAG=\"devicemanagerkit_js\"",
4979a732c7Sopenharmony_ci    "LOG_DOMAIN=0xD004110",
5079a732c7Sopenharmony_ci  ]
5179a732c7Sopenharmony_ci
5279a732c7Sopenharmony_ci  external_deps = [
5379a732c7Sopenharmony_ci    "access_token:libtokenid_sdk",
5479a732c7Sopenharmony_ci    "bounds_checking_function:libsec_shared",
5579a732c7Sopenharmony_ci    "bundle_framework:appexecfwk_base",
5679a732c7Sopenharmony_ci    "c_utils:utils",
5779a732c7Sopenharmony_ci    "hilog:libhilog",
5879a732c7Sopenharmony_ci    "ipc:ipc_core",
5979a732c7Sopenharmony_ci    "json:nlohmann_json_static",
6079a732c7Sopenharmony_ci    "napi:ace_napi",
6179a732c7Sopenharmony_ci  ]
6279a732c7Sopenharmony_ci
6379a732c7Sopenharmony_ci  subsystem_name = "distributedhardware"
6479a732c7Sopenharmony_ci  relative_install_dir = "module/distributedhardware"
6579a732c7Sopenharmony_ci  part_name = "device_manager"
6679a732c7Sopenharmony_ci}
67