16ea96550Sopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd.
26ea96550Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
36ea96550Sopenharmony_ci# you may not use this file except in compliance with the License.
46ea96550Sopenharmony_ci# You may obtain a copy of the License at
56ea96550Sopenharmony_ci#
66ea96550Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
76ea96550Sopenharmony_ci#
86ea96550Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
96ea96550Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
106ea96550Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116ea96550Sopenharmony_ci# See the License for the specific language governing permissions and
126ea96550Sopenharmony_ci# limitations under the License.
136ea96550Sopenharmony_ci
146ea96550Sopenharmony_ciimport("//base/security/security_guard/security_guard.gni")
156ea96550Sopenharmony_ciimport("//build/ohos.gni")
166ea96550Sopenharmony_ci
176ea96550Sopenharmony_ciohos_shared_library("securityguard_napi") {
186ea96550Sopenharmony_ci  include_dirs = [
196ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/constants/include",
206ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/log/include",
216ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/utils/include",
226ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/js/napi",
236ea96550Sopenharmony_ci    "${sg_root_dir}/interfaces/inner_api/obtaindata/include",
246ea96550Sopenharmony_ci    "${sg_root_dir}/interfaces/inner_api/collect/include",
256ea96550Sopenharmony_ci    "${sg_root_dir}/interfaces/inner_api/collector/include",
266ea96550Sopenharmony_ci    "${sg_root_dir}/interfaces/inner_api/data_collect_manager/include",
276ea96550Sopenharmony_ci    "${sg_root_dir}/interfaces/inner_api/classify/include",
286ea96550Sopenharmony_ci    "${sg_root_dir}/interfaces/inner_api/acquire/include",
296ea96550Sopenharmony_ci    "${sg_root_dir}/interfaces/inner_api/common/include",
306ea96550Sopenharmony_ci  ]
316ea96550Sopenharmony_ci
326ea96550Sopenharmony_ci  sources = [
336ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/acquire/src/acquire_data_manager_callback_service.cpp",
346ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/acquire/src/acquire_data_manager_callback_stub.cpp",
356ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/classify/src/risk_analysis_manager_callback_service.cpp",
366ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/classify/src/risk_analysis_manager_callback_stub.cpp",
376ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/classify/src/risk_analysis_manager_proxy.cpp",
386ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/collect/src/event_info.cpp",
396ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/collector/src/collector_service_loader.cpp",
406ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/collector/src/security_collector_manager_callback_service.cpp",
416ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/collector/src/security_collector_manager_callback_stub.cpp",
426ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/collector/src/security_collector_manager_proxy.cpp",
436ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/collector/src/security_collector_subscribe_info.cpp",
446ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/data_collect_manager/src/data_collect_manager_callback_service.cpp",
456ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/data_collect_manager/src/data_collect_manager_callback_stub.cpp",
466ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/data_collect_manager/src/data_collect_manager_proxy.cpp",
476ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/obtaindata/src/security_event_query_callback_service.cpp",
486ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/obtaindata/src/security_event_query_callback_stub.cpp",
496ea96550Sopenharmony_ci    "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp",
506ea96550Sopenharmony_ci    "napi_request_data_manager.cpp",
516ea96550Sopenharmony_ci    "napi_security_event_querier.cpp",
526ea96550Sopenharmony_ci    "security_guard_napi.cpp",
536ea96550Sopenharmony_ci    "security_guard_sdk_adaptor.cpp",
546ea96550Sopenharmony_ci  ]
556ea96550Sopenharmony_ci
566ea96550Sopenharmony_ci  sanitize = {
576ea96550Sopenharmony_ci    integer_overflow = true
586ea96550Sopenharmony_ci    ubsan = true
596ea96550Sopenharmony_ci    boundary_sanitize = true
606ea96550Sopenharmony_ci    cfi = true
616ea96550Sopenharmony_ci    cfi_cross_dso = true
626ea96550Sopenharmony_ci    debug = false
636ea96550Sopenharmony_ci  }
646ea96550Sopenharmony_ci  branch_protector_ret = "pac_ret"
656ea96550Sopenharmony_ci
666ea96550Sopenharmony_ci  deps = [ "${sg_root_dir}/frameworks/common/collector:libsg_collector_sdk" ]
676ea96550Sopenharmony_ci
686ea96550Sopenharmony_ci  external_deps = [
696ea96550Sopenharmony_ci    "c_utils:utils",
706ea96550Sopenharmony_ci    "hilog:libhilog",
716ea96550Sopenharmony_ci    "ipc:ipc_core",
726ea96550Sopenharmony_ci    "napi:ace_napi",
736ea96550Sopenharmony_ci    "samgr:samgr_proxy",
746ea96550Sopenharmony_ci  ]
756ea96550Sopenharmony_ci
766ea96550Sopenharmony_ci  relative_install_dir = "module/security"
776ea96550Sopenharmony_ci  subsystem_name = "security"
786ea96550Sopenharmony_ci  part_name = "security_guard"
796ea96550Sopenharmony_ci}
80