1# Copyright (c) 2021 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/graphic_config.gni")
16
17## Build bootanimation {{{
18config("bootanimation_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "include",
23    "${graphic_2d_root}/rosen/modules/render_service_client",
24  ]
25
26  cflags = [
27    "-Wall",
28    "-Werror",
29    "-g3",
30    "-fdata-sections",
31    "-ffunction-sections",
32    "-fno-asynchronous-unwind-tables",
33    "-fno-unwind-tables",
34    "-Os",
35  ]
36
37  defines = []
38  defines += gpu_defines
39  if (player_framework_enable) {
40    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
41  }
42
43  if (defined(use_rosen_drawing) && use_rosen_drawing) {
44    defines += [ "USE_ROSEN_DRAWING" ]
45  }
46}
47
48ohos_executable("bootanimation") {
49  install_enable = true
50
51  sources = [
52    "src/boot_animation_controller.cpp",
53    "src/boot_animation_operation.cpp",
54    "src/boot_animation_strategy.cpp",
55    "src/boot_associative_display_strategy.cpp",
56    "src/boot_compatible_display_strategy.cpp",
57    "src/boot_compile_progress.cpp",
58    "src/boot_independent_display_strategy.cpp",
59    "src/boot_picture_player.cpp",
60    "src/boot_sound_player.cpp",
61    "src/boot_video_player.cpp",
62    "src/main.cpp",
63    "src/util.cpp",
64  ]
65
66  configs = [ ":bootanimation_config" ]
67
68  deps = [
69    "$graphic_2d_root:libbootanimation_utils",
70    "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics",
71    "$graphic_2d_root/rosen/modules/render_service_client:librender_service_client",
72  ]
73
74  if (defined(use_new_render_context) && use_new_render_context) {
75    deps += [ "$graphic_2d_root/rosen/modules/render_service_base/src/render_backend:librender_backend" ]
76  }
77
78  external_deps = [
79    "cJSON:cjson_static",
80    "c_utils:utils",
81    "config_policy:configpolicy_util",
82    "eventhandler:libeventhandler",
83    "hilog:libhilog",
84    "hitrace:hitrace_meter",
85    "ipc:ipc_core",
86    "samgr:samgr_proxy",
87    "skia:skia_canvaskit",
88    "zlib:libz",
89  ]
90
91  if (player_framework_enable) {
92    external_deps += [ "player_framework:media_client" ]
93  }
94
95  if (is_standard_system) {
96    external_deps += [ "init:libbegetutil" ]
97  } else {
98    external_deps += [ "startup:syspara" ]
99  }
100
101  part_name = "graphic_2d"
102  subsystem_name = "graphic"
103}
104
105## Build bootanimation }}}
106
107## Install boot animation resource to /system/etc/graphic/ {{{
108ohos_prebuilt_etc("bootanimation_pics") {
109  source = "data/bootpic.zip"
110  relative_install_dir = "graphic"
111  part_name = "graphic_2d"
112  subsystem_name = "graphic"
113}
114
115ohos_prebuilt_etc("bootanimation_sounds") {
116  source = "data/bootsound.wav"
117  relative_install_dir = "graphic"
118  part_name = "graphic_2d"
119  subsystem_name = "graphic"
120}
121
122ohos_prebuilt_etc("bootanimation_video") {
123  source = "data/bootvideo.mp4"
124  relative_install_dir = "graphic"
125  part_name = "graphic_2d"
126  subsystem_name = "graphic"
127}
128
129## Install boot animation resource to /system/etc/graphic/ }}}
130
131## Install boot animation para to /system/etc/param/ {{{
132ohos_prebuilt_etc("bootanimation_para") {
133  source = "etc/bootanimation.para"
134  relative_install_dir = "param"
135  part_name = "graphic_2d"
136  subsystem_name = "graphic"
137}
138## Install boot animation para to /system/etc/param/ }}}
139