196279301Sopenharmony_ci# Copyright (C) 2024 Huawei Device Co., Ltd.
296279301Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
396279301Sopenharmony_ci# you may not use this file except in compliance with the License.
496279301Sopenharmony_ci# You may obtain a copy of the License at
596279301Sopenharmony_ci#
696279301Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
796279301Sopenharmony_ci#
896279301Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
996279301Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1096279301Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1196279301Sopenharmony_ci# See the License for the specific language governing permissions and
1296279301Sopenharmony_ci# limitations under the License.
1396279301Sopenharmony_ci
1496279301Sopenharmony_ciimport("//base/notification/distributed_notification_service/notification.gni")
1596279301Sopenharmony_ciimport("//build/ohos.gni")
1696279301Sopenharmony_ci
1796279301Sopenharmony_ciohos_shared_library("cj_notification_manager_ffi") {
1896279301Sopenharmony_ci  sanitize = {
1996279301Sopenharmony_ci    integer_overflow = true
2096279301Sopenharmony_ci    ubsan = true
2196279301Sopenharmony_ci    boundary_sanitize = true
2296279301Sopenharmony_ci    cfi = true
2396279301Sopenharmony_ci    cfi_cross_dso = true
2496279301Sopenharmony_ci    debug = false
2596279301Sopenharmony_ci  }
2696279301Sopenharmony_ci  branch_protector_ret = "pac_ret"
2796279301Sopenharmony_ci
2896279301Sopenharmony_ci  include_dirs = [
2996279301Sopenharmony_ci    "include",
3096279301Sopenharmony_ci    "${component_path}/interfaces/inner_api",
3196279301Sopenharmony_ci    "${component_path}/frameworks/core/common/include",
3296279301Sopenharmony_ci  ]
3396279301Sopenharmony_ci
3496279301Sopenharmony_ci  if (!defined(defines)) {
3596279301Sopenharmony_ci    defines = []
3696279301Sopenharmony_ci  }
3796279301Sopenharmony_ci
3896279301Sopenharmony_ci  use_exceptions = true
3996279301Sopenharmony_ci
4096279301Sopenharmony_ci  if (product_name != "ohos-sdk") {
4196279301Sopenharmony_ci    deps = [ "${frameworks_module_ans_path}:ans_innerkits" ]
4296279301Sopenharmony_ci    external_deps = [
4396279301Sopenharmony_ci      "ability_base:want",
4496279301Sopenharmony_ci      "ability_base:zuri",
4596279301Sopenharmony_ci      "ability_runtime:ability_manager",
4696279301Sopenharmony_ci      "ability_runtime:abilitykit_native",
4796279301Sopenharmony_ci      "ability_runtime:data_ability_helper",
4896279301Sopenharmony_ci      "c_utils:utils",
4996279301Sopenharmony_ci      "hilog:libhilog",
5096279301Sopenharmony_ci      "image_framework:cj_image_ffi",
5196279301Sopenharmony_ci      "ipc:ipc_core",
5296279301Sopenharmony_ci      "napi:ace_napi",
5396279301Sopenharmony_ci      "napi:cj_bind_ffi",
5496279301Sopenharmony_ci      "napi:cj_bind_native",
5596279301Sopenharmony_ci    ]
5696279301Sopenharmony_ci    sources = [
5796279301Sopenharmony_ci      "src/inner_errors.cpp",
5896279301Sopenharmony_ci      "src/notification_manager_ffi.cpp",
5996279301Sopenharmony_ci      "src/notification_manager_impl.cpp",
6096279301Sopenharmony_ci      "src/notification_utils.cpp",
6196279301Sopenharmony_ci    ]
6296279301Sopenharmony_ci  } else {
6396279301Sopenharmony_ci    defines += [ "PREVIEWER" ]
6496279301Sopenharmony_ci    sources = [ "src/notification_manager_mock.cpp" ]
6596279301Sopenharmony_ci  }
6696279301Sopenharmony_ci
6796279301Sopenharmony_ci  if (current_os == "ohos") {
6896279301Sopenharmony_ci    defines += [ "OHOS_PLATFORM" ]
6996279301Sopenharmony_ci  }
7096279301Sopenharmony_ci
7196279301Sopenharmony_ci  if (current_os == "mingw") {
7296279301Sopenharmony_ci    defines += [ "WINDOWS_PLATFORM" ]
7396279301Sopenharmony_ci  }
7496279301Sopenharmony_ci
7596279301Sopenharmony_ci  innerapi_tags = [ "platformsdk" ]
7696279301Sopenharmony_ci  subsystem_name = "${subsystem_name}"
7796279301Sopenharmony_ci  part_name = "${component_name}"
7896279301Sopenharmony_ci}
79