1# Copyright (c) 2022-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("../../windowmanager_aafwk.gni")
16
17config("libwindow_extension_private_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    "include",
22    "include/zidl",
23    "../extension_connection/include",
24    "../extension_connection/include/zidl",
25    "../../interfaces/kits/napi/window_runtime/window_napi",
26    "../../interfaces/innerkits/extension",
27    "../../interfaces/innerkits/wm",
28    "../../window_scene/interfaces/innerkits/include",
29  ]
30}
31
32## Build libwindow_extension.so
33ohos_shared_library("libwindow_extension") {
34  branch_protector_ret = "pac_ret"
35  sanitize = {
36    cfi = true
37    cfi_cross_dso = true
38    cfi_vcall_icall_only = true
39    debug = false
40  }
41  sources = [
42    "../extension_connection/src/zidl/window_extension_client_proxy.cpp",
43    "src/js_window_extension.cpp",
44    "src/js_window_extension_context.cpp",
45    "src/window_extension.cpp",
46    "src/window_extension_context.cpp",
47    "src/window_extension_stub_impl.cpp",
48    "src/zidl/window_extension_stub.cpp",
49  ]
50
51  configs = [
52    ":libwindow_extension_private_config",
53    "../../resources/config/build:coverage_flags",
54  ]
55
56  deps = [
57    "${window_base_path}/utils:libwmutil",
58    "../../interfaces/kits/napi/window_runtime:window_native_kit",
59    "../../window_scene/interfaces/innerkits:libwsutils",
60    "../../wm:libwm",
61  ]
62
63  external_deps = [
64    "ability_base:want",
65    "ability_runtime:ability_context_native",
66    "ability_runtime:ability_manager",
67    "ability_runtime:ability_start_options",
68    "ability_runtime:app_context",
69    "ability_runtime:extensionkit_native",
70    "ability_runtime:napi_common",
71    "ability_runtime:runtime",
72    "c_utils:utils",
73    "common_event_service:cesfwk_innerkits",
74    "eventhandler:libeventhandler",
75    "graphic_2d:librender_service_client",
76    "hilog:libhilog",
77    "hitrace:hitrace_meter",
78    "input:libmmi-client",
79    "ipc:ipc_single",
80    "napi:ace_napi",
81  ]
82
83  part_name = "window_manager"
84  subsystem_name = "window"
85
86  defines = []
87  if (build_variant == "user") {
88    defines += [ "IS_RELEASE_VERSION" ]
89  }
90}
91
92config("window_extension_module_private_config") {
93  visibility = [ ":*" ]
94
95  include_dirs = [ "include" ]
96}
97
98## Build libwindow_extension_module.so
99ohos_shared_library("window_extension_module") {
100  branch_protector_ret = "pac_ret"
101  sanitize = {
102    cfi = true
103    cfi_cross_dso = true
104    cfi_vcall_icall_only = true
105    debug = false
106  }
107  sources = [ "src/window_extension_module_loader.cpp" ]
108
109  configs = [
110    ":window_extension_module_private_config",
111    "../../resources/config/build:coverage_flags",
112  ]
113
114  deps = [ ":libwindow_extension" ]
115
116  external_deps = [
117    "ability_runtime:ability_context_native",
118    "ability_runtime:abilitykit_native",
119    "common_event_service:cesfwk_innerkits",
120    "hilog:libhilog",
121    "napi:ace_napi",
122  ]
123  relative_install_dir = "extensionability/"
124  subsystem_name = "window"
125  part_name = "window_manager"
126}
127
128group("test") {
129  testonly = true
130  deps = [ "test:test" ]
131}
132