• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 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("//foundation/graphic/graphic_2d/rosen/modules/platform/config.gni")
16
17# ace_skia {{{
18group("ace_skia") {
19  if (is_arkui_x) {
20    public_deps = [ "//third_party/skia:skia_$platform" ]
21  } else {
22    public_external_deps = [ "skia:skia_canvaskit" ]
23  }
24}
25
26# ace_skia }}}
27
28# eventhandler {{{
29group("eventhandler") {
30  if (platform == "ohos") {
31    public_external_deps = [ "eventhandler:libeventhandler" ]
32  } else if (cross_platform) {
33    public_deps = [ "$appframework_root/ability/ability_runtime/cross_platform/frameworks/native/base/event_handler:cross_platform_event_handler" ]
34  } else {
35    public_deps = [ ":impl_eventhandler" ]
36  }
37}
38
39config("eventhandler_config") {
40  if (platform != "ohos") {
41    include_dirs = [ "eventhandler" ]
42  }
43}
44
45ohos_source_set("impl_eventhandler") {
46  public_configs = [ ":eventhandler_config" ]
47  sources = [
48    "eventhandler_impl/epoll_io_waiter_mingw.cpp",
49    "eventhandler_impl/event_handler.cpp",
50    "eventhandler_impl/event_queue.cpp",
51    "eventhandler_impl/event_runner.cpp",
52    "eventhandler_impl/file_descriptor_listener.cpp",
53    "eventhandler_impl/inner_event.cpp",
54    "eventhandler_impl/native_implement_eventhandler.cpp",
55    "eventhandler_impl/none_io_waiter.cpp",
56  ]
57  defines = [ "LOG_DOMAIN=0xD001200" ]
58  cflags = [ "-std=c++17" ]
59  deps = [ ":utils" ]
60
61  external_deps = [
62    "hilog:libhilog",
63    "libuv:uv",
64  ]
65
66  if (is_arkui_x) {
67    defines += [ "CROSSPLATFORM" ]
68  }
69
70  part_name = "graphic_2d"
71  subsystem_name = "graphic"
72}
73
74# eventhandler }}}
75
76# hilog {{{
77ohos_source_set("hilog") {
78  if (current_os == "android" || current_os == "ios") {
79    public_deps = hilog_deps
80  } else {
81    public_external_deps = [ "hilog:libhilog" ]
82  }
83  part_name = "graphic_2d"
84  subsystem_name = "graphic"
85}
86
87# hilog }}}
88
89# image_native {{{
90group("image_native") {
91  if (platform == "ohos") {
92    public_external_deps = [ "image_framework:image_native" ]
93  } else if (platform == "android" || platform == "ios") {
94    public_external_deps = [ "image_framework:image_native" ]
95  } else {
96    public_deps = [ ":mock_image_native" ]
97  }
98}
99
100config("image_native_config") {
101  if (!(platform == "ohos" || platform == "android" || platform == "ios")) {
102    include_dirs = [ "image_native" ]
103  }
104}
105
106ohos_source_set("mock_image_native") {
107  public_configs = [ ":image_native_config" ]
108  sources = [ "image_native/pixel_map.cpp" ]
109  deps = [ ":utils" ]
110  cflags = [ "-DIMAGE_COLORSPACE_FLAG" ]
111  part_name = "graphic_2d"
112  subsystem_name = "graphic"
113}
114
115# image_native }}}
116
117# ipc_core {{{
118group("ipc_core") {
119  if (platform == "ohos") {
120    public_external_deps = [ "ipc:ipc_core" ]
121  } else {
122    public_deps = [ ":mock_ipc_core" ]
123  }
124}
125
126config("ipc_core_config") {
127  if (platform != "ohos") {
128    include_dirs = [ "ipc_core" ]
129  }
130}
131
132ohos_source_set("mock_ipc_core") {
133  public_configs = [ ":ipc_core_config" ]
134  sources = [
135    "ipc_core/ipc_object_stub.cpp",
136    "ipc_core/iremote_broker.cpp",
137    "ipc_core/iremote_object.cpp",
138    "ipc_core/message_option.cpp",
139    "ipc_core/message_parcel.cpp",
140    "ipc_core/peer_holder.cpp",
141  ]
142  deps = [ ":utils" ]
143  part_name = "graphic_2d"
144  subsystem_name = "graphic"
145}
146
147# ipc_core }}}
148
149# utils {{{
150group("utils") {
151  if (platform == "ohos") {
152    public_external_deps = [ "c_utils:utils" ]
153  } else if (platform == "android" || platform == "ios") {
154    public_external_deps = [ "c_utils:utilsbase" ]
155  } else {
156    public_deps = [ ":mock_utils" ]
157  }
158  if (platform == "ios") {
159    public_configs = [ ":ios_utils_config" ]
160  }
161}
162
163config("utils_config") {
164  if (!(platform == "ohos" || platform == "android" || platform == "ios")) {
165    include_dirs = [ "utils" ]
166  }
167
168  if (platform == "ios") {
169    defines = [ "IOS_PLATFORM" ]
170  }
171}
172
173config("ios_utils_config") {
174  defines = [ "IOS_PLATFORM" ]
175}
176
177ohos_source_set("mock_utils") {
178  public_external_deps = []
179  if (current_os == "ios") {
180    public_configs = [ ":ios_utils_config" ]
181    public_external_deps += [ "c_utils:utilsbase" ]
182  } else {
183    public_configs = [ ":utils_config" ]
184    sources = [
185      "utils/directory_ex.cpp",
186      "utils/parcel.cpp",
187      "utils/refbase.cpp",
188    ]
189    public_external_deps += [ "bounds_checking_function:libsec_shared" ]
190  }
191  part_name = "graphic_2d"
192  subsystem_name = "graphic"
193}
194
195# utils }}}
196
197group("platform") {
198  public_deps = [
199    ":ace_skia",
200    ":eventhandler",
201    ":hilog",
202    ":ipc_core",
203    ":utils",
204  ]
205}
206