• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2024 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
17ispreview = false
18if (is_mingw || is_mac || is_linux) {
19  ispreview = true
20}
21if (!ispreview) {
22  group("previewer_window") {
23  }
24
25  group("previewer_window_napi") {
26  }
27} else {
28  if (current_os == "mac") {
29    suffix = ".dylib"
30  } else if (current_os == "linux") {
31    suffix = ".so"
32  } else if (current_os == "mingw") {
33    suffix = ".dll"
34  }
35
36  config("previewer_window_config") {
37    visibility = [ "*:*" ]
38    visibility += [
39      "${graphic_base_path}/graphic_2d/rosen/modules/platform/image_native",
40      "${graphic_base_path}/graphic_2d/rosen/modules/platform/ipc_core",
41      "${graphic_base_path}/graphic_2d/rosen/modules/platform/utils",
42    ]
43
44    include_dirs = [
45      "include",
46      "../utils/include",
47      "${graphic_base_path}/graphic_2d/rosen/modules/platform/utils",
48      "${graphic_base_path}/graphic_2d/rosen/modules/platform/ipc_core",
49      "${graphic_base_path}/graphic_2d/rosen/modules/platform/image_native",
50      "${window_base_path}/interfaces/innerkits/wm",
51    ]
52  }
53
54  ohos_shared_library("previewer_window") {
55    libs = []
56
57    public_configs = [
58      ":previewer_window_config",
59      "${ability_runtime_path}/frameworks/simulator/common:ability_simulator_common_config",
60    ]
61    sources = [
62      "../utils/src/window_manager_hilog.cpp",
63      "../utils/src/window_transition_info.cpp",
64      "../utils/src/wm_math.cpp",
65      "src/vsync_station.cpp",
66      "src/window.cpp",
67      "src/window_display.cpp",
68      "src/window_impl.cpp",
69      "src/window_model.cpp",
70      "src/window_option.cpp",
71      "src/window_scene.cpp",
72    ]
73
74    include_dirs = [
75      "include",
76      "${arkui_path}/ace_engine/adapter/preview/external/multimodalinput",
77      "${arkui_path}/ace_engine/",
78      "mock",
79      "../utils/include",
80      "${ide_previewer_external_path}",
81    ]
82    public_deps = [
83      "${graphic_base_path}/graphic_2d/rosen/modules/platform:ipc_core",
84      "${graphic_base_path}/graphic_2d/rosen/modules/platform:utils",
85    ]
86
87    external_deps = [
88      "ace_engine:ace_uicontent",
89      "graphic_2d:librender_service_client",
90      "hilog:libhilog",
91    ]
92
93    cflags = [ "-std=c++11" ]
94    part_name = "window_manager"
95    subsystem_name = "window"
96  }
97
98  config("previewer_window_napi_config") {
99    visibility = [ ":*" ]
100
101    include_dirs = [
102      "../interfaces/kits/napi/window_runtime/window_napi",
103      "../interfaces/kits/napi/window_runtime/window_stage_napi",
104    ]
105  }
106
107  ohos_shared_library("previewer_window_napi") {
108    public_configs = [ ":previewer_window_napi_config" ]
109
110    libs = []
111
112    sources = [
113      "${ability_runtime_path}/frameworks/simulator/ability_simulator/src/js_runtime_utils.cpp",
114      "../interfaces/kits/napi/window_runtime/window_napi/js_window.cpp",
115      "../interfaces/kits/napi/window_runtime/window_napi/js_window_utils.cpp",
116      "../interfaces/kits/napi/window_runtime/window_stage_napi/js_window_stage.cpp",
117      "../utils/src/window_manager_hilog.cpp",
118
119      # mock
120      "mock/js_transition_controller.cpp",
121      "mock/js_window_listener.cpp",
122      "mock/js_window_register_manager.cpp",
123      "mock/permission.cpp",
124      "mock/pixel_map_napi.cpp",
125      "mock/window_manager_napi/js_window_manager.cpp",
126      "mock/window_manager_napi/window_manager_module.cpp",
127    ]
128
129    include_dirs = [
130      ".",
131      "include",
132      "../utils/include",
133      "mock",
134      "${ability_runtime_path}/interfaces/inner_api/runtime/include",
135    ]
136
137    deps = [
138      ":previewer_window",
139      "${graphic_base_path}/graphic_2d/rosen/modules/platform:eventhandler",
140      "${graphic_base_path}/graphic_2d/rosen/modules/platform:utils",
141    ]
142
143    external_deps = [
144      "ace_engine:ace_uicontent",
145      "hilog:libhilog",
146      "napi:ace_napi",
147    ]
148
149    if (!build_ohos_sdk && !is_mingw) {
150      external_deps += [ "ability_runtime:ability_manager" ]
151    }
152
153    cflags_cc = [ "-DWINDOW_PREVIEW" ]
154    cflags = [ "-std=c++11" ]
155
156    part_name = "window_manager"
157    subsystem_name = "window"
158  }
159
160  ohos_copy("window_stage_copy_modules") {
161    deps = []
162    sources = []
163    napi_modules = [ "window_stage_modules:windowstage" ]
164
165    foreach(module, napi_modules) {
166      deps += [ module ]
167      out_path = get_label_info(module, "root_out_dir")
168      out_name = get_label_info(module, "name")
169      sources += [ out_path + "/window/window_manager/lib" + out_name + suffix ]
170    }
171
172    target_path = get_label_info(":copy_previewer_library", "target_out_dir")
173
174    outputs =
175        [ target_path +
176          "/previewer/common/bin/module/application/{{source_file_part}}" ]
177    part_name = "window_manager"
178    subsystem_name = "window"
179  }
180  ohos_copy("copy_previewer_library") {
181    shared_library_path = get_label_info(":previewer_window", "root_out_dir")
182    sources = [ shared_library_path +
183                "/window/window_manager/libpreviewer_window" + suffix ]
184    deps = [ ":previewer_window" ]
185
186    if (current_os == "mingw" || current_os == "mac") {
187      deps += [ ":window_stage_copy_modules" ]
188      shared_library_path =
189          get_label_info(":previewer_window_napi", "root_out_dir")
190      sources += [ shared_library_path +
191                   "/window/window_manager/libpreviewer_window_napi" + suffix ]
192      deps += [ ":previewer_window_napi" ]
193    }
194
195    outputs = [ target_out_dir + "/previewer/common/bin/{{source_file_part}}" ]
196    module_source_dir = target_out_dir + "/previewer/common/bin/"
197    module_install_name = ""
198
199    part_name = "window_manager"
200    subsystem_name = "window"
201  }
202}
203