# Copyright (C) 2021-2022 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. import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") import("//build/ohos.gni") SUBSYSTEM_DIR = "../../.." config("call_manager_js_config") { include_dirs = [ "napi/include" ] } jspath = "napi/src/call.js" # compile .js to .abc. action("gen_call_abc") { visibility = [ ":*" ] script = "../../../../../arkcompiler/ets_frontend/es2panda/scripts/generate_js_bytecode.py" args = [ "--src-js", rebase_path(jspath), "--dst-file", rebase_path(target_out_dir + "/call.abc"), "--frontend-tool-path", rebase_path("${es2abc_build_path}"), "--module", ] deps = [ "../../../../../arkcompiler/ets_frontend/es2panda:es2panda_build" ] inputs = [ jspath ] outputs = [ target_out_dir + "/call.abc" ] } base_output_path = get_label_info(":call_js", "target_out_dir") call_obj_path = base_output_path + "/call.o" gen_js_obj("call_js") { input = jspath output = call_obj_path dep = ":gen_call_abc" } abc_output_path = get_label_info(":call_abc", "target_out_dir") call_abc_obj_path = abc_output_path + "/call_abc.o" gen_js_obj("call_abc") { input = "$target_out_dir/call.abc" output = call_abc_obj_path dep = ":gen_call_abc" } ohos_shared_library("call") { sanitize = { cfi = false # napi target, not required to enable cfi cfi_cross_dso = false debug = false } branch_protector_ret = "pac_ret" sources = [ "napi/src/napi_call_ability_callback.cpp", "napi/src/napi_call_manager.cpp", "napi/src/napi_call_manager_callback.cpp", "napi/src/napi_call_manager_utils.cpp", "napi/src/native_module.cpp", ] public_configs = [ ":call_manager_js_config" ] deps = [ ":call_abc", ":call_js", "$SUBSYSTEM_DIR/call_manager/frameworks/native:tel_call_manager_api", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:ability_manager", "c_utils:utils", "core_service:libtel_common", "core_service:tel_core_service_api", "hilog:libhilog", "image_framework:image", "image_framework:image_native", "init:libbegetutil", "libuv:uv", "napi:ace_napi", ] cflags_cc = [ "-Wunused", "-Wunreachable-code", "-fno-exceptions", "-fno-rtti", "-fstack-protector-all", "-Os", "-flto", "-Wno-unused-but-set-variable", "-fdata-sections", "-ffunction-sections", "-fno-asynchronous-unwind-tables", "-fno-unwind-tables", ] ldflags = [ "-flto", "-Wl,--gc-sections", ] defines = [ "TELEPHONY_LOG_TAG = \"CallManagerJsApi\"", "LOG_DOMAIN = 0xD001F10", ] part_name = "call_manager" subsystem_name = "telephony" relative_install_dir = "module/telephony" }