• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/config/components/ets_frontend/es2abc_config.gni")
15import("//build/ohos.gni")
16import("//build/ohos/ace/ace.gni")
17import("//build/templates/abc/ohos_abc.gni")
18
19SUBSYSTEM_DIR = "../../.."
20config("call_manager_js_config") {
21  include_dirs = [ "napi/include" ]
22}
23
24jspath = "napi/src/call.js"
25
26# compile .js to .abc.
27es2abc_gen_abc("gen_call_abc") {
28  src_js = rebase_path(jspath)
29  dst_file = rebase_path(target_out_dir + "/call.abc")
30  in_puts = [ jspath ]
31  out_puts = [ target_out_dir + "/call.abc" ]
32  extra_args = [ "--module" ]
33}
34
35base_output_path = get_label_info(":call_js", "target_out_dir")
36call_obj_path = base_output_path + "/call.o"
37gen_js_obj("call_js") {
38  input = jspath
39  output = call_obj_path
40  dep = ":gen_call_abc"
41}
42
43abc_output_path = get_label_info(":call_abc", "target_out_dir")
44call_abc_obj_path = abc_output_path + "/call_abc.o"
45gen_js_obj("call_abc") {
46  input = "$target_out_dir/call.abc"
47  output = call_abc_obj_path
48  dep = ":gen_call_abc"
49}
50
51ohos_shared_library("call") {
52  sanitize = {
53    cfi = false  # napi target, not required to enable cfi
54    cfi_cross_dso = false
55    debug = false
56  }
57  branch_protector_ret = "pac_ret"
58  sources = [
59    "napi/src/napi_call_ability_callback.cpp",
60    "napi/src/napi_call_manager.cpp",
61    "napi/src/napi_call_manager_callback.cpp",
62    "napi/src/napi_call_manager_utils.cpp",
63    "napi/src/native_module.cpp",
64  ]
65
66  public_configs = [ ":call_manager_js_config" ]
67
68  deps = [
69    ":call_abc",
70    ":call_js",
71    "$SUBSYSTEM_DIR/call_manager/frameworks/native:tel_call_manager_api",
72  ]
73
74  external_deps = [
75    "ability_base:base",
76    "ability_base:want",
77    "ability_runtime:ability_manager",
78    "ability_runtime:napi_common",
79    "c_utils:utils",
80    "core_service:libtel_common",
81    "core_service:tel_core_service_api",
82    "hilog:libhilog",
83    "image_framework:image",
84    "image_framework:image_native",
85    "init:libbegetutil",
86    "libuv:uv",
87    "napi:ace_napi",
88  ]
89
90  cflags_cc = [
91    "-Wunused",
92    "-Wunreachable-code",
93    "-fno-exceptions",
94    "-fno-rtti",
95    "-fstack-protector-all",
96    "-Os",
97    "-flto",
98    "-Wno-unused-but-set-variable",
99    "-fdata-sections",
100    "-ffunction-sections",
101    "-fno-asynchronous-unwind-tables",
102    "-fno-unwind-tables",
103  ]
104
105  ldflags = [
106    "-flto",
107    "-Wl,--gc-sections",
108  ]
109
110  defines = [
111    "TELEPHONY_LOG_TAG = \"CallManagerJsApi\"",
112    "LOG_DOMAIN = 0xD001F10",
113  ]
114
115  part_name = "call_manager"
116  subsystem_name = "telephony"
117  relative_install_dir = "module/telephony"
118}
119