• 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("//build/ohos/ace/ace_args.gni")
16
17defines = [
18  "OHOS_PLATFORM",
19  "OHOS_STANDARD_SYSTEM",
20]
21
22declare_args() {
23  ace_engine_feature_enable_accessibility = false
24  ace_engine_feature_enable_web = false
25  ace_engine_feature_enable_gpu = true
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_engine_feature_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
98state_mgmt_use_aot = true
99
100if (defined(preview_support) && preview_support) {
101  defines += [ "PREVIEW" ]
102}
103
104if (defined(image_components_support) && image_components_support) {
105  defines += [ "IMAGE_SUPPORTED" ]
106}
107
108if (defined(video_components_support) && video_components_support) {
109  defines += [ "VIDEO_SUPPORTED" ]
110}
111
112if (defined(video_support_jsstack) && video_support_jsstack) {
113  defines += [ "SUPPORT_JSSTACK" ]
114}
115
116if (defined(is_experiment_build) && is_experiment_build) {
117  web_components_support = true
118  accessibility_support = true
119}
120
121if (defined(web_components_support) && web_components_support) {
122  defines += [ "WEB_SUPPORTED" ]
123}
124
125if (defined(enable_ability_component) && enable_ability_component) {
126  defines += [ "ABILITY_COMPONENT_SUPPORTED" ]
127}
128
129if (disable_gpu || enable_rosen_backend) {
130  defines += [ "GPU_DISABLED" ]
131}
132
133if (disable_gpu) {
134  defines += [ "UPLOAD_GPU_DISABLED" ]
135}
136
137if (remote_window_support) {
138  defines += [ "REMOTE_WINDOW_SUPPORTED" ]
139}
140
141if (effect_component_support) {
142  defines += [ "EFFECT_COMPONENT_SUPPORTED" ]
143}
144
145if (xcomponent_components_support) {
146  defines += [ "XCOMPONENT_SUPPORTED" ]
147}
148
149if (pixel_map_support) {
150  defines += [ "PIXEL_MAP_SUPPORTED" ]
151}
152
153if (enable_rosen_backend) {
154  defines += [ "ENABLE_ROSEN_BACKEND" ]
155}
156
157if (enable_standard_input) {
158  defines += [ "ENABLE_STANDARD_INPUT" ]
159}
160
161if (multiple_window_support) {
162  defines += [ "MULTIPLE_WINDOW_SUPPORTED" ]
163}
164
165if (model_component_support) {
166  defines += [ "MODEL_COMPONENT_SUPPORTED" ]
167}
168
169if (use_build_in_js_engine) {
170  defines += [ "HIDDEN_SYMBOL" ]
171}
172
173if (window_scene_support) {
174  defines += [ "WINDOW_SCENE_SUPPORTED" ]
175}
176
177if (enable_drag_framework) {
178  defines += [ "ENABLE_DRAG_FRAMEWORK" ]
179}
180
181if (defined(global_parts_info.multimedia_media_library)) {
182  media_library_exists = true
183  defines += [ "MEDIA_LIBRARY_EXISTS" ]
184} else {
185  media_library_exists = false
186}
187
188if (defined(global_parts_info.hiviewdfx_hichecker)) {
189  hichecker_exists = true
190  defines += [ "HICHECKER_EXISTS" ]
191} else {
192  hichecker_exists = false
193}
194
195if (dynamic_component_support) {
196  defines += [ "DYNAMIC_COMPONENT_SUPPORT" ]
197}
198
199if (!build_ohos_sdk) {
200  defines += [ "FORM_BUTTON_COMPONENT_SUPPORT" ]
201}
202
203if (vsync_timeout_check) {
204  defines += [ "VSYNC_TIMEOUT_CHECK" ]
205}
206
207if (defined(state_mgmt_use_aot) && state_mgmt_use_aot) {
208  defines += [ "STATE_MGMT_USE_AOT" ]
209}
210
211cflags_cc = [
212  "-Wno-thread-safety-attributes",
213  "-Wno-thread-safety-analysis",
214]
215