1# Copyright (c) 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") 16 17cflags_cc = [] 18 19es2abc_gen_abc("gen_print_extension_abc") { 20 src_js = rebase_path("print_extension.js") 21 dst_file = rebase_path(target_out_dir + "/print_extension.abc") 22 in_puts = [ "print_extension.js" ] 23 out_puts = [ target_out_dir + "/print_extension.abc" ] 24 extra_args = [ "--module" ] 25} 26 27gen_js_obj("print_extension_js") { 28 input = "print_extension.js" 29 output = target_out_dir + "/print_extension.o" 30} 31 32gen_js_obj("print_extension_abc") { 33 input = get_label_info(":gen_print_extension_abc", "target_out_dir") + 34 "/print_extension.abc" 35 output = target_out_dir + "/print_extension_abc.o" 36 dep = ":gen_print_extension_abc" 37} 38 39ohos_shared_library("printextensionability_napi") { 40 sources = [ "print_extension_module.cpp" ] 41 cflags_cc += [ 42 "-fno-exceptions", 43 "-fdata-sections", 44 "-ffunction-sections", 45 "-fno-asynchronous-unwind-tables", 46 "-fno-unwind-tables", 47 "-flto", 48 "-Os", 49 ] 50 branch_protector_ret = "pac_ret" 51 sanitize = { 52 cfi = true 53 cfi_cross_dso = true 54 boundary_sanitize = true 55 debug = false 56 integer_overflow = true 57 ubsan = true 58 } 59 60 deps = [ 61 ":print_extension_abc", 62 ":print_extension_js", 63 ] 64 65 external_deps = [ "napi:ace_napi" ] 66 67 if (build_variant == "user") { 68 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 69 } 70 71 relative_install_dir = "module/app/ability" 72 subsystem_name = "print" 73 part_name = "print_fwk" 74} 75