1# Copyright (c) 2023-2023 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/ohos.gni") 15import("//build/ohos/ace/ace.gni") 16import("//build/templates/abc/ohos_abc.gni") 17 18es2abc_gen_abc("gen_extension_window_abc") { 19 src_js = rebase_path("extension_window.js") 20 dst_file = rebase_path(target_out_dir + "/extension_window.abc") 21 in_puts = [ "extension_window.js" ] 22 out_puts = [ target_out_dir + "/extension_window.abc" ] 23 extra_args = [ "--module" ] 24} 25 26gen_js_obj("extension_window_js") { 27 input = "extension_window.js" 28 output = target_out_dir + "/extension_window.o" 29} 30 31gen_js_obj("extension_window_abc") { 32 input = get_label_info(":gen_extension_window_abc", "target_out_dir") + 33 "/extension_window.abc" 34 output = target_out_dir + "/extension_window_abc.o" 35 dep = ":gen_extension_window_abc" 36} 37 38ohos_shared_library("extensionwindow") { 39 branch_protector_ret = "pac_ret" 40 sanitize = { 41 cfi = true 42 cfi_cross_dso = true 43 cfi_vcall_icall_only = true 44 debug = false 45 } 46 sources = [ "extension_window_module.cpp" ] 47 48 configs = [ "../../../../resources/config/build:coverage_flags" ] 49 50 deps = [ 51 ":extension_window_abc", 52 ":extension_window_js", 53 ] 54 55 external_deps = [ "napi:ace_napi" ] 56 57 relative_install_dir = "module/application" 58 part_name = "window_manager" 59 subsystem_name = "window" 60} 61 62config("extension_window_kit_config") { 63 visibility = [ ":*" ] 64 65 include_dirs = [ 66 "../window_runtime/window_napi", 67 "../../../innerkits/wm", 68 "../../../../utils/include", 69 "../../../../wm/include", 70 "../../../../wmserver/include", 71 ] 72} 73 74ohos_shared_library("extensionwindow_napi") { 75 branch_protector_ret = "pac_ret" 76 sanitize = { 77 cfi = true 78 cfi_cross_dso = true 79 cfi_vcall_icall_only = true 80 debug = false 81 } 82 sources = [ 83 "js_extension_window.cpp", 84 "js_extension_window_listener.cpp", 85 "js_extension_window_register_manager.cpp", 86 "js_extension_window_utils.cpp", 87 ] 88 89 configs = [ 90 ":extension_window_kit_config", 91 "../../../../resources/config/build:coverage_flags", 92 ] 93 94 include_dirs = [ "extension_window" ] 95 deps = [ 96 "../../../../utils:libwmutil", 97 "../../../../utils:libwmutil_base", 98 "../../../../wm:libwm", 99 "../window_runtime:window_native_kit", 100 ] 101 102 public_configs = [ ":extension_window_kit_config" ] 103 104 external_deps = [ 105 "ability_runtime:runtime", 106 "ace_engine:ace_uicontent", 107 "c_utils:utils", 108 "eventhandler:libeventhandler", 109 "hilog:libhilog", 110 "hitrace:hitrace_meter", 111 "napi:ace_napi", 112 ] 113 114 innerapi_tags = [ "platformsdk" ] 115 part_name = "window_manager" 116 subsystem_name = "window" 117 118 defines = [] 119 if (build_variant == "user") { 120 defines += [ "IS_RELEASE_VERSION" ] 121 } 122} 123