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 "../extension_window", 67 "../window_runtime/window_napi", 68 "../../../innerkits/wm", 69 "../../../../utils/include", 70 "../../../../wm/include", 71 "../../../../wmserver/include", 72 ] 73} 74 75ohos_shared_library("extensionwindow_napi") { 76 branch_protector_ret = "pac_ret" 77 sanitize = { 78 cfi = true 79 cfi_cross_dso = true 80 cfi_vcall_icall_only = true 81 debug = false 82 } 83 sources = [ 84 "js_extension_window.cpp", 85 "js_extension_window_listener.cpp", 86 "js_extension_window_register_manager.cpp", 87 "js_extension_window_utils.cpp", 88 ] 89 90 configs = [ 91 ":extension_window_kit_config", 92 "../../../../resources/config/build:coverage_flags", 93 ] 94 public_configs = [ ":extension_window_kit_config" ] 95 96 include_dirs = [ "extension_window" ] 97 deps = [ 98 "../../../../utils:libwmutil", 99 "../../../../utils:libwmutil_base", 100 "../../../../wm:libwm", 101 "../window_runtime:window_native_kit", 102 ] 103 104 external_deps = [ 105 "ability_runtime:ability_manager", 106 "ability_runtime:runtime", 107 "ace_engine:ace_uicontent", 108 "bundle_framework:appexecfwk_base", 109 "c_utils:utils", 110 "eventhandler:libeventhandler", 111 "hilog:libhilog", 112 "hitrace:hitrace_meter", 113 "napi:ace_napi", 114 ] 115 116 innerapi_tags = [ "platformsdk" ] 117 part_name = "window_manager" 118 subsystem_name = "window" 119 120 defines = [] 121 if (build_variant == "user") { 122 defines += [ "IS_RELEASE_VERSION" ] 123 } 124} 125