1# Copyright (c) 2023-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.
13import("//build/ohos_var.gni")
14import("//foundation/arkui/ace_engine/ace_config.gni")
15import("//foundation/arkui/ace_engine/adapter/preview/build/config.gni")
16
17# Avoid conditional judgment branches caused by dynamic library suffixes.
18if (use_mac) {
19  dylib_suffix = ".dylib"
20  label_res =
21      "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac"
22  label_hilog =
23      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_mac"
24} else if (use_mingw_win) {
25  dylib_suffix = ".dll"
26  label_res =
27      "//base/global/resource_management/frameworks/resmgr:global_resmgr_win"
28  label_hilog =
29      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_windows"
30} else if (use_linux || host_cpu == "arm64") {
31  dylib_suffix = ".so"
32  label_res =
33      "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux"
34  label_hilog =
35      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_linux"
36}
37
38common_bin = [
39  {
40    label = "//third_party/curl:curl_shared"
41    subsystem_name = "thirdparty"
42    part_name = "curl"
43  },
44  {
45    label = "//third_party/nghttp2/lib:libnghttp2_shared"
46    subsystem_name = "thirdparty"
47    part_name = "nghttp2"
48  },
49  {
50    label = "//third_party/bounds_checking_function:libsec_shared"
51    subsystem_name = "thirdparty"
52    part_name = "bounds_checking_function"
53  },
54  {
55    label = "//foundation/arkui/napi:ace_napi"
56    subsystem_name = "arkui"
57    part_name = "napi"
58  },
59  {
60    label = "//third_party/cJSON:cjson"
61    subsystem_name = "thirdparty"
62    part_name = "cJSON"
63  },
64  {
65    label = "//third_party/icu/icu4c:shared_icui18n"
66    subsystem_name = "thirdparty"
67    part_name = "icu"
68    lib_names = [ "hmicui18n" ]
69  },
70  {
71    label = "//third_party/icu/icu4c:shared_icuuc"
72    subsystem_name = "thirdparty"
73    part_name = "icu"
74    lib_names = [ "hmicuuc" ]
75  },
76  {
77    label = "//base/global/i18n/frameworks/intl:intl_util"
78    subsystem_name = "global"
79    part_name = "i18n"
80    lib_names = [ "intl_util" ]
81  },
82  {
83    label = "//third_party/libuv:uv"
84    subsystem_name = "thirdparty"
85    part_name = "libuv"
86  },
87  {
88    label = "//foundation/graphic/graphic_2d/rosen/modules/glfw_render_context:libglfw_render_context"
89    subsystem_name = "graphic"
90    part_name = "graphic_2d"
91  },
92  {
93    label = "//foundation/graphic/graphic_2d/rosen/modules/render_service_base:librender_service_base"
94    subsystem_name = "graphic"
95    part_name = "graphic_2d"
96  },
97  {
98    label = "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client"
99    subsystem_name = "graphic"
100    part_name = "graphic_2d"
101  },
102  {
103    label = "//third_party/glfw:glfw"
104    subsystem_name = "thirdparty"
105    part_name = "glfw"
106  },
107  {
108    label = "//foundation/graphic/graphic_2d/rosen/modules/texgine:libtexgine"
109    subsystem_name = "graphic"
110    part_name = "graphic_2d"
111  },
112  {
113    label = "//foundation/graphic/graphic_2d/rosen/modules/texgine/texgine_drawing:libtexgine_drawing"
114    subsystem_name = "graphic"
115    part_name = "graphic_2d"
116  },
117  {
118    label = "//foundation/graphic/graphic_2d/rosen/modules/graphics_effect:libgraphics_effect"
119    subsystem_name = "graphic"
120    part_name = "graphic_2d"
121  },
122  {
123    label = "//third_party/jsoncpp:jsoncpp"
124    subsystem_name = "thirdparty"
125    part_name = "jsoncpp"
126  },
127  {
128    label = "//third_party/skia:skia_canvaskit"
129    subsystem_name = "thirdparty"
130    part_name = "skia"
131  },
132  {
133    label = "//arkcompiler/ets_runtime:libark_jsruntime"
134    subsystem_name = "arkcompiler"
135    part_name = "ets_runtime"
136  },
137  {
138    label = "//arkcompiler/toolchain/tooling:libark_ecma_debugger"
139    subsystem_name = "arkcompiler"
140    part_name = "toolchain"
141    lib_names = [ "ark_tooling" ]
142  },
143  {
144    label = "//arkcompiler/toolchain/inspector:ark_debugger"
145    subsystem_name = "arkcompiler"
146    part_name = "toolchain"
147    lib_names = [ "ark_inspector" ]
148  },
149  {
150    label = "//third_party/openssl:libssl_shared"
151    subsystem_name = "thirdparty"
152    part_name = "openssl"
153    lib_names = [ "ssl_openssl" ]
154  },
155  {
156    label = "//third_party/openssl:libcrypto_shared"
157    subsystem_name = "thirdparty"
158    part_name = "openssl"
159    lib_names = [ "crypto_openssl" ]
160  },
161  {
162    label = label_res
163    subsystem_name = "global"
164    part_name = "resource_management"
165  },
166  {
167    label = label_hilog
168    subsystem_name = "hiviewdfx"
169    part_name = "hilog"
170  },
171  {
172    label = "//foundation/arkui/ace_engine/build:libace_compatible"
173    subsystem_name = "arkui"
174    part_name = "ace_engine"
175  },
176  {
177    label = "//foundation/arkui/ace_engine/interfaces/inner_api/ace:ace_forward_compatibility"
178    subsystem_name = "arkui"
179    part_name = "ace_engine"
180  },
181  {
182    label =
183        "//foundation/arkui/ace_engine/interfaces/inner_api/ace:ace_uicontent"
184    subsystem_name = "arkui"
185    part_name = "ace_engine"
186  },
187  {
188    label = "//foundation/arkui/ace_engine/interfaces/inner_api/drawable_descriptor:drawable_descriptor"
189    subsystem_name = "arkui"
190    part_name = "ace_engine"
191  },
192]
193
194if (enable_graphic_text_gine) {
195  common_bin += [
196    {
197      label = "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics_new"
198      subsystem_name = "graphic"
199      part_name = "graphic_2d"
200    },
201    {
202      label = "//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text:rosen_text"
203      subsystem_name = "graphic"
204      part_name = "graphic_2d"
205    },
206  ]
207}
208
209if (defined(use_rosen_drawing) && use_rosen_drawing) {
210  common_bin += [
211    {
212      label = "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics"
213      subsystem_name = "graphic"
214      part_name = "graphic_2d"
215    },
216  ]
217
218  common_bin += [
219    {
220      label = "//foundation/graphic/graphic_2d/interfaces/kits/napi/graphic/drawing:drawing_napi_impl"
221      subsystem_name = "graphic"
222      part_name = "graphic_2d"
223    },
224  ]
225
226  common_bin -= [
227    {
228      label = "//foundation/graphic/graphic_2d/rosen/modules/texgine/texgine_drawing:libtexgine_drawing"
229      subsystem_name = "graphic"
230      part_name = "graphic_2d"
231    },
232  ]
233}
234
235_arkui_shared_libs = [
236  {
237    label = "//foundation/arkui/ace_engine/interfaces/napi/kits/drawabledescriptor:drawabledescriptor"
238    subsystem_name = "arkui"
239    part_name = "ace_engine"
240    lib_names = [ "drawabledescriptor" ]
241  },
242]
243
244if (defined(current_platform.config)) {
245  platform_config = current_platform.config
246  if (defined(platform_config.enable_component_test) &&
247      platform_config.enable_component_test && use_mingw_win) {
248    _arkui_shared_libs += [
249      {
250        label = "//foundation/arkui/ace_engine/interfaces/napi/kits/component_test:componenttest"
251        subsystem_name = "arkui"
252        part_name = "ace_engine"
253        lib_names = [ "componenttest" ]
254      },
255    ]
256  }
257}
258
259napi_modules = [
260  {
261    prefix = "arkui"
262    shard_libs = _arkui_shared_libs
263  },
264  {
265    prefix = "multimedia"
266    shard_libs = [
267      {
268        label = "//foundation/multimedia/av_session/avpicker:avcastpicker"
269        subsystem_name = "multimedia"
270        part_name = "av_session"
271        lib_names = [ "avcastpicker" ]
272      },
273    ]
274  },
275  {
276    prefix = ""
277    shard_libs = [
278      {
279        label = "//base/hiviewdfx/hilog/interfaces/js/kits/napi:libhilognapi"
280        subsystem_name = "hiviewdfx"
281        part_name = "hilog"
282        lib_names = [ "hilog_napi" ]
283      },
284      {
285        label = "//commonlibrary/ets_utils/js_api_module/buffer:buffer_packages"
286        subsystem_name = "commonlibrary"
287        part_name = "ets_utils"
288        lib_names = [ "buffer" ]
289      },
290      {
291        label =
292            "//foundation/window/window_manager/previewer:previewer_window_napi"
293        subsystem_name = "window"
294        part_name = "window_manager"
295        lib_names = [ "previewer_window_napi" ]
296      },
297      {
298        label = "//foundation/arkui/ace_engine/interfaces/napi/kits:napi_group"
299        subsystem_name = "arkui"
300        part_name = "ace_engine"
301        lib_names = [
302          "configuration",
303          "device",
304          "font",
305          "grid",
306          "measure",
307          "mediaquery",
308          "prompt",
309          "promptaction",
310          "router",
311          "animator",
312        ]
313      },
314    ]
315  },
316  {
317    prefix = "util"
318    shard_libs = [
319      {
320        label = "//commonlibrary/ets_utils/js_util_module/container:container_packages"
321        subsystem_name = "commonlibrary"
322        part_name = "ets_utils"
323        lib_names = [
324          "arraylist",
325          "deque",
326          "queue",
327          "vector",
328          "linkedlist",
329          "list",
330          "stack",
331          "struct",
332          "treemap",
333          "treeset",
334          "hashmap",
335          "hashset",
336          "lightweightmap",
337          "lightweightset",
338          "plainarray",
339        ]
340      },
341    ]
342  },
343  {
344    prefix = "arkui/advanced"
345    shard_libs = [
346      {
347        label = "//foundation/arkui/ace_engine/advanced_ui_component/chip/interfaces:chip"
348        subsystem_name = "arkui"
349        part_name = "ace_engine"
350        lib_names = [ "chip" ]
351      },
352      {
353        label = "//foundation/arkui/ace_engine/advanced_ui_component/chipgroup/interfaces:chipgroup"
354        subsystem_name = "arkui"
355        part_name = "ace_engine"
356        lib_names = [ "chipgroup" ]
357      },
358      {
359        label = "//foundation/arkui/ace_engine/advanced_ui_component/counter/interfaces:counter"
360        subsystem_name = "arkui"
361        part_name = "ace_engine"
362        lib_names = [ "counter" ]
363      },
364      {
365        label = "//foundation/arkui/ace_engine/advanced_ui_component/segmentbutton/interfaces:segmentbutton"
366        subsystem_name = "arkui"
367        part_name = "ace_engine"
368        lib_names = [ "segmentbutton" ]
369      },
370      {
371        label = "//foundation/arkui/ace_engine/advanced_ui_component/composelistitem/interfaces:composelistitem"
372        subsystem_name = "arkui"
373        part_name = "ace_engine"
374        lib_names = [ "composelistitem" ]
375      },
376      {
377        label = "//foundation/arkui/ace_engine/advanced_ui_component/composetitlebar/interfaces:composetitlebar"
378        subsystem_name = "arkui"
379        part_name = "ace_engine"
380        lib_names = [ "composetitlebar" ]
381      },
382      {
383        label = "//foundation/arkui/ace_engine/advanced_ui_component/dialog/interfaces:dialog"
384        subsystem_name = "arkui"
385        part_name = "ace_engine"
386        lib_names = [ "dialog" ]
387      },
388      {
389        label = "//foundation/arkui/ace_engine/advanced_ui_component/editabletitlebar/interfaces:editabletitlebar"
390        subsystem_name = "arkui"
391        part_name = "ace_engine"
392        lib_names = [ "editabletitlebar" ]
393      },
394      {
395        label = "//foundation/arkui/ace_engine/advanced_ui_component/filter/interfaces:filter"
396        subsystem_name = "arkui"
397        part_name = "ace_engine"
398        lib_names = [ "filter" ]
399      },
400      {
401        label = "//foundation/arkui/ace_engine/advanced_ui_component/progressbutton/interfaces:progressbutton"
402        subsystem_name = "arkui"
403        part_name = "ace_engine"
404        lib_names = [ "progressbutton" ]
405      },
406      {
407        label = "//foundation/arkui/ace_engine/advanced_ui_component/selecttitlebar/interfaces:selecttitlebar"
408        subsystem_name = "arkui"
409        part_name = "ace_engine"
410        lib_names = [ "selecttitlebar" ]
411      },
412      {
413        label = "//foundation/arkui/ace_engine/advanced_ui_component/splitlayout/interfaces:splitlayout"
414        subsystem_name = "arkui"
415        part_name = "ace_engine"
416        lib_names = [ "splitlayout" ]
417      },
418      {
419        label = "//foundation/arkui/ace_engine/advanced_ui_component/subheader/interfaces:subheader"
420        subsystem_name = "arkui"
421        part_name = "ace_engine"
422        lib_names = [ "subheader" ]
423      },
424      {
425        label = "//foundation/arkui/ace_engine/advanced_ui_component/swiperefresher/interfaces:swiperefresher"
426        subsystem_name = "arkui"
427        part_name = "ace_engine"
428        lib_names = [ "swiperefresher" ]
429      },
430      {
431        label = "//foundation/arkui/ace_engine/advanced_ui_component/tabtitlebar/interfaces:tabtitlebar"
432        subsystem_name = "arkui"
433        part_name = "ace_engine"
434        lib_names = [ "tabtitlebar" ]
435      },
436      {
437        label = "//foundation/arkui/ace_engine/advanced_ui_component/toolbar/interfaces:toolbar"
438        subsystem_name = "arkui"
439        part_name = "ace_engine"
440        lib_names = [ "toolbar" ]
441      },
442      {
443        label = "//foundation/arkui/ace_engine/advanced_ui_component/treeview/interfaces:treeview"
444        subsystem_name = "arkui"
445        part_name = "ace_engine"
446        lib_names = [ "treeview" ]
447      },
448      {
449        label = "//foundation/arkui/ace_engine/advanced_ui_component/selectionmenu/interfaces:selectionmenu"
450        subsystem_name = "arkui"
451        part_name = "ace_engine"
452        lib_names = [ "selectionmenu" ]
453      },
454      {
455        label = "//foundation/arkui/ace_engine/advanced_ui_component/popup/interfaces:popup"
456        subsystem_name = "arkui"
457        part_name = "ace_engine"
458        lib_names = [ "popup" ]
459      },
460      {
461        label = "//foundation/arkui/ace_engine/advanced_ui_component/gridobjectsortcomponent/interfaces:gridobjectsortcomponent"
462        subsystem_name = "arkui"
463        part_name = "ace_engine"
464        lib_names = [ "gridobjectsortcomponent" ]
465      },
466      {
467        label = "//foundation/arkui/ace_engine/advanced_ui_component/exceptionprompt/interfaces:exceptionprompt"
468        subsystem_name = "arkui"
469        part_name = "ace_engine"
470        lib_names = [ "exceptionprompt" ]
471      },
472      {
473        label = "//foundation/arkui/ace_engine/advanced_ui_component/fullscreenlaunchcomponent/interfaces:fullscreenlaunchcomponent"
474        subsystem_name = "arkui"
475        part_name = "ace_engine"
476        lib_names = [ "fullscreenlaunchcomponent" ]
477      },
478      {
479        label = "//foundation/arkui/ace_engine/advanced_ui_component/innerfullscreenlaunchcomponent/interfaces:innerfullscreenlaunchcomponent"
480        subsystem_name = "arkui"
481        part_name = "ace_engine"
482        lib_names = [ "innerfullscreenlaunchcomponent" ]
483      },
484      {
485        label = "//foundation/arkui/ace_engine/advanced_ui_component/formmenu/interfaces:formmenu"
486        subsystem_name = "arkui"
487        part_name = "ace_engine"
488        lib_names = [ "formmenu" ]
489      },
490      {
491        label = "//foundation/arkui/ace_engine/advanced_ui_component/foldsplitcontainer/interfaces:foldsplitcontainer"
492        subsystem_name = "arkui"
493        part_name = "ace_engine"
494        lib_names = [ "foldsplitcontainer" ]
495      },
496    ]
497  },
498  {
499    prefix = "atomicservice"
500    shard_libs = [
501      {
502        label = "//foundation/arkui/ace_engine/advanced_ui_component/atomicservicenavigation/interfaces:atomicservicenavigation"
503        subsystem_name = "arkui"
504        part_name = "ace_engine"
505        lib_names = [ "atomicservicenavigation" ]
506      },
507      {
508        label = "//foundation/arkui/ace_engine/advanced_ui_component/atomicservicetabs/interfaces:atomicservicetabs"
509        subsystem_name = "arkui"
510        part_name = "ace_engine"
511        lib_names = [ "atomicservicetabs" ]
512      },
513      {
514        label = "//foundation/arkui/ace_engine/advanced_ui_component/atomicserviceweb/interfaces:atomicserviceweb"
515        subsystem_name = "arkui"
516        part_name = "ace_engine"
517        lib_names = [ "atomicserviceweb" ]
518      },
519      {
520        label = "//foundation/arkui/ace_engine/advanced_ui_component/interstitialdialogaction/interfaces:interstitialdialogaction"
521        subsystem_name = "arkui"
522        part_name = "ace_engine"
523        lib_names = [ "interstitialdialogaction" ]
524      },
525    ]
526  },
527]
528
529if (defined(use_rosen_drawing) && use_rosen_drawing) {
530  napi_modules += [
531    {
532      prefix = "graphics"
533      shard_libs = [
534        {
535          label = "//foundation/graphic/graphic_2d/interfaces/kits/napi/graphic/drawing:drawing_napi"
536          subsystem_name = "graphic"
537          part_name = "graphic_2d"
538          lib_names = [ "drawing_napi" ]
539        },
540        {
541          label = "//foundation/graphic/graphic_2d/interfaces/kits/napi/graphic/ui_effect:uieffect_napi"
542          subsystem_name = "graphic"
543          part_name = "graphic_2d"
544          lib_names = [ "uieffect_napi" ]
545        },
546      ]
547    },
548  ]
549}
550
551if (use_mac || use_mingw_win) {
552  common_bin += [
553    {
554      label = "//foundation/distributeddatamgr/preferences/interfaces/inner_api:native_preferences"
555      subsystem_name = "distributeddatamgr"
556      part_name = "preferences"
557    },
558    {
559      label = "//foundation/distributeddatamgr/relational_store/interfaces/inner_api/rdb:native_rdb"
560      subsystem_name = "distributeddatamgr"
561      part_name = "relational_store"
562    },
563    {
564      label = "//third_party/sqlite:sqlite_sdk"
565      subsystem_name = "thirdparty"
566      part_name = "sqlite"
567    },
568    {
569      label = "//third_party/openssl:libcrypto_restool"
570      subsystem_name = "thirdparty"
571      part_name = "openssl"
572    },
573    {
574      label = "//foundation/distributeddatamgr/kv_store/kvstoremock/interfaces/innerkits/distributeddata:distributeddata_inner_mock"
575      subsystem_name = "distributeddatamgr"
576      part_name = "kv_store"
577    },
578    {
579      label = "//foundation/distributeddatamgr/kv_store/kvstoremock/distributeddb:distributeddb_mock"
580      subsystem_name = "distributeddatamgr"
581      part_name = "kv_store"
582    },
583    {
584      label = "//third_party/zlib:shared_libz"
585      subsystem_name = "thirdparty"
586      part_name = "zlib"
587      lib_names = [ "shared_libz" ]
588    },
589    {
590      label = "//foundation/filemanagement/file_api/utils/filemgmt_libhilog:filemgmt_libhilog"
591      subsystem_name = "filemanagement"
592      part_name = "file_api"
593      lib_names = [ "filemgmt_libhilog" ]
594    },
595    {
596      label = "//foundation/filemanagement/file_api/utils/filemgmt_libn:filemgmt_libn"
597      subsystem_name = "filemanagement"
598      part_name = "file_api"
599      lib_names = [ "filemgmt_libn" ]
600    },
601  ]
602
603  napi_modules += [
604    {
605      prefix = "data"
606      shard_libs = [
607        {
608          label = "//foundation/distributeddatamgr/preferences/frameworks/js/napi/preferences:preferences"
609          subsystem_name = "distributeddatamgr"
610          part_name = "preferences"
611        },
612        {
613          label = "//foundation/distributeddatamgr/relational_store/frameworks/js/napi/rdb:rdb"
614          subsystem_name = "distributeddatamgr"
615          part_name = "relational_store"
616        },
617        {
618          label = "//foundation/distributeddatamgr/kv_store/kvstoremock/interfaces/jskits/distributeddata:distributeddata"
619          subsystem_name = "distributeddatamgr"
620          part_name = "kv_store"
621        },
622        {
623          label = "//foundation/distributeddatamgr/kv_store/kvstoremock/interfaces/jskits/distributedkvstore:distributedkvstore"
624          subsystem_name = "distributeddatamgr"
625          part_name = "kv_store"
626        },
627      ]
628    },
629    {
630      prefix = "net"
631      shard_libs = [
632        {
633          label =
634              "//foundation/communication/netstack/frameworks/js/napi/http:http"
635          subsystem_name = "communication"
636          part_name = "netstack"
637        },
638      ]
639    },
640    {
641      prefix = "file"
642      shard_libs = [
643        {
644          label = "//foundation/filemanagement/file_api/interfaces/kits/js:fs"
645          subsystem_name = "filemanagement"
646          part_name = "file_api"
647        },
648      ]
649    },
650  ]
651}
652