# Copyright (c) 2024 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("//build/ohos.gni") if (support_jsapi) { import("//build/config/components/ets_frontend/es2abc_config.gni") } if (support_jsapi) { es2abc_gen_abc("gen_js_leak_watcher_abc") { src_js = rebase_path("js_leak_watcher.js") dst_file = rebase_path(target_out_dir + "/js_leak_watcher.abc") in_puts = [ "js_leak_watcher.js" ] out_puts = [ target_out_dir + "/js_leak_watcher.abc" ] extra_args = [ "--module" ] } gen_js_obj("js_leak_watcher_js") { input = "js_leak_watcher.js" output = target_out_dir + "/js_leak_watcher.o" } gen_js_obj("js_leak_watcher_abc") { input = get_label_info(":gen_js_leak_watcher_abc", "target_out_dir") + "/js_leak_watcher.abc" output = target_out_dir + "/js_leak_watcher_abc.o" dep = ":gen_js_leak_watcher_abc" } } ohos_shared_library("jsleakwatcher") { if (support_jsapi) { sources = [ "js_leak_watcher_module.cpp" ] deps = [ ":js_leak_watcher_abc", ":js_leak_watcher_js", ] external_deps = [ "ets_runtime:libark_jsruntime", "napi:ace_napi", ] cflags = [ "-fstack-protector-strong" ] relative_install_dir = "module/hiviewdfx" subsystem_name = "hiviewdfx" part_name = "hichecker" } }