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  external_deps = [
75    "cJSON:cjson_static",
76    "c_utils:utils",
77    "config_policy:configpolicy_util",
78    "eventhandler:libeventhandler",
79    "hilog:libhilog",
80    "hitrace:hitrace_meter",
81    "ipc:ipc_core",
82    "samgr:samgr_proxy",
83    "skia:skia_canvaskit",
84    "zlib:libz",
85  ]
86
87  if (player_framework_enable) {
88    external_deps += [ "player_framework:media_client" ]
89  }
90
91  if (is_standard_system) {
92    external_deps += [ "init:libbegetutil" ]
93  } else {
94    external_deps += [ "startup:syspara" ]
95  }
96
97  part_name = "graphic_2d"
98  subsystem_name = "graphic"
99
100  sanitize = {
101    cfi = true
102    cfi_cross_dso = true
103    debug = false
104    cfi_vcall_icall_only = true
105    integer_overflow = true
106    ubsan = true
107    boundary_sanitize = true
108  }
109  branch_protector_ret = "pac_ret"
110}
111
112## Build bootanimation }}}
113
114## Install boot animation resource to /system/etc/graphic/ {{{
115ohos_prebuilt_etc("bootanimation_pics") {
116  source = "data/bootpic.zip"
117  relative_install_dir = "graphic"
118  part_name = "graphic_2d"
119  subsystem_name = "graphic"
120}
121
122ohos_prebuilt_etc("bootanimation_sounds") {
123  source = "data/bootsound.wav"
124  relative_install_dir = "graphic"
125  part_name = "graphic_2d"
126  subsystem_name = "graphic"
127}
128
129ohos_prebuilt_etc("bootanimation_video") {
130  source = "data/bootvideo.mp4"
131  relative_install_dir = "graphic"
132  part_name = "graphic_2d"
133  subsystem_name = "graphic"
134}
135
136## Install boot animation resource to /system/etc/graphic/ }}}
137
138## Install boot animation para to /system/etc/param/ {{{
139ohos_prebuilt_etc("bootanimation_para") {
140  source = "etc/bootanimation.para"
141  relative_install_dir = "param"
142  part_name = "graphic_2d"
143  subsystem_name = "graphic"
144}
145## Install boot animation para to /system/etc/param/ }}}
146