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("//build/ohos/ace/ace_args.gni")
16import("//foundation/graphic/graphic_2d/graphic_config.gni")
17
18defines = [
19  "OHOS_PLATFORM",
20  "OHOS_STANDARD_SYSTEM",
21]
22
23declare_args() {
24  ace_engine_feature_enable_accessibility = false
25  ace_engine_feature_enable_web = false
26}
27
28js_engines = []
29ark_engine = {
30  engine_name = "ark"
31  engine_path = "jsi"
32  engine_defines = [ "USE_ARK_ENGINE" ]
33}
34js_engines += [ ark_engine ]
35
36if (ace_enable_gpu) {
37  disable_gpu = false
38} else {
39  disable_gpu = true
40}
41
42if (ace_engine_feature_enable_accessibility) {
43  accessibility_support = true
44}
45
46if (ace_engine_feature_enable_web) {
47  web_components_support = true
48}
49
50use_build_in_js_engine = true
51use_external_icu = "shared"
52ohos_standard_fontmgr = true
53sk_use_hilog = true
54rich_components_support = true
55advance_components_support = false
56remote_window_support = true
57effect_component_support = true
58xcomponent_components_support = true
59pixel_map_support = true
60js_pa_support = true
61connect_server_support = true
62hdc_register_support = true
63pa_engine_path = "adapter/ohos/entrance/pa_engine"
64enable_rosen_backend = true
65if (defined(global_parts_info.distributeddatamgr_udmf) &&
66    defined(global_parts_info.msdp_device_status)) {
67  enable_drag_framework = true
68} else {
69  enable_drag_framework = false
70}
71if (defined(global_parts_info.inputmethod_imf)) {
72  enable_standard_input = true
73} else {
74  enable_standard_input = false
75}
76build_container_scope_lib = true
77multiple_window_support = true
78enable_ability_component = true
79video_components_support = true
80video_support_jsstack = true
81image_components_support = true
82preview_support = false
83if (defined(global_parts_info.distributeddatamgr_pasteboard)) {
84  enable_system_clipboard = true
85} else {
86  enable_system_clipboard = false
87}
88enable_image_compression = true
89if (defined(global_parts_info.graphic_graphic_3d)) {
90  model_component_support = true
91} else {
92  model_component_support = false
93}
94
95window_scene_support = true
96dynamic_component_support = true
97vsync_timeout_check = true
98use_fast_taskpool = false
99state_mgmt_use_aot = true
100
101if (defined(preview_support) && preview_support) {
102  defines += [ "PREVIEW" ]
103}
104
105if (defined(image_components_support) && image_components_support) {
106  defines += [ "IMAGE_SUPPORTED" ]
107}
108
109if (defined(video_components_support) && video_components_support) {
110  defines += [ "VIDEO_SUPPORTED" ]
111}
112
113if (defined(video_support_jsstack) && video_support_jsstack) {
114  defines += [ "SUPPORT_JSSTACK" ]
115}
116
117if (defined(is_experiment_build) && is_experiment_build) {
118  web_components_support = true
119  accessibility_support = true
120}
121
122if (defined(web_components_support) && web_components_support) {
123  defines += [ "WEB_SUPPORTED" ]
124}
125
126if (defined(enable_ability_component) && enable_ability_component) {
127  defines += [ "ABILITY_COMPONENT_SUPPORTED" ]
128}
129
130if (disable_gpu || enable_rosen_backend) {
131  defines += [ "GPU_DISABLED" ]
132}
133
134if (disable_gpu) {
135  defines += [ "UPLOAD_GPU_DISABLED" ]
136}
137
138if (remote_window_support) {
139  defines += [ "REMOTE_WINDOW_SUPPORTED" ]
140}
141
142if (effect_component_support) {
143  defines += [ "EFFECT_COMPONENT_SUPPORTED" ]
144}
145
146if (xcomponent_components_support) {
147  defines += [ "XCOMPONENT_SUPPORTED" ]
148}
149
150if (pixel_map_support) {
151  defines += [ "PIXEL_MAP_SUPPORTED" ]
152}
153
154if (enable_rosen_backend) {
155  defines += [ "ENABLE_ROSEN_BACKEND" ]
156}
157
158if (enable_standard_input) {
159  defines += [ "ENABLE_STANDARD_INPUT" ]
160}
161
162if (multiple_window_support) {
163  defines += [ "MULTIPLE_WINDOW_SUPPORTED" ]
164}
165
166if (model_component_support) {
167  defines += [ "MODEL_COMPONENT_SUPPORTED" ]
168}
169
170if (use_build_in_js_engine) {
171  defines += [ "HIDDEN_SYMBOL" ]
172}
173
174if (window_scene_support) {
175  defines += [ "WINDOW_SCENE_SUPPORTED" ]
176}
177
178if (enable_drag_framework) {
179  defines += [ "ENABLE_DRAG_FRAMEWORK" ]
180}
181
182if (defined(global_parts_info.multimedia_media_library)) {
183  media_library_exists = true
184  defines += [ "MEDIA_LIBRARY_EXISTS" ]
185} else {
186  media_library_exists = false
187}
188
189if (defined(global_parts_info.hiviewdfx_hichecker)) {
190  hichecker_exists = true
191  defines += [ "HICHECKER_EXISTS" ]
192} else {
193  hichecker_exists = false
194}
195
196if (dynamic_component_support) {
197  defines += [ "DYNAMIC_COMPONENT_SUPPORT" ]
198}
199
200if (vsync_timeout_check) {
201  defines += [ "VSYNC_TIMEOUT_CHECK" ]
202}
203
204if (use_fast_taskpool) {
205  defines += [ "USE_FAST_TASKPOOL" ]
206}
207
208if (defined(state_mgmt_use_aot) && state_mgmt_use_aot) {
209  defines += [ "STATE_MGMT_USE_AOT" ]
210}
211
212cflags_cc = [
213  "-Wno-thread-safety-attributes",
214  "-Wno-thread-safety-analysis",
215]
216