1e9297d28Sopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
2e9297d28Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3e9297d28Sopenharmony_ci# you may not use this file except in compliance with the License.
4e9297d28Sopenharmony_ci# You may obtain a copy of the License at
5e9297d28Sopenharmony_ci#
6e9297d28Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7e9297d28Sopenharmony_ci#
8e9297d28Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9e9297d28Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10e9297d28Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11e9297d28Sopenharmony_ci# See the License for the specific language governing permissions and
12e9297d28Sopenharmony_ci# limitations under the License.
13e9297d28Sopenharmony_ci
14e9297d28Sopenharmony_ciimport("//build/ohos.gni")
15e9297d28Sopenharmony_ciimport("//foundation/graphic/graphic_2d/graphic_config.gni")
16e9297d28Sopenharmony_ci
17e9297d28Sopenharmony_ci## Build bootanimation {{{
18e9297d28Sopenharmony_ciconfig("bootanimation_config") {
19e9297d28Sopenharmony_ci  visibility = [ ":*" ]
20e9297d28Sopenharmony_ci
21e9297d28Sopenharmony_ci  include_dirs = [
22e9297d28Sopenharmony_ci    "include",
23e9297d28Sopenharmony_ci    "${graphic_2d_root}/rosen/modules/render_service_client",
24e9297d28Sopenharmony_ci  ]
25e9297d28Sopenharmony_ci
26e9297d28Sopenharmony_ci  cflags = [
27e9297d28Sopenharmony_ci    "-Wall",
28e9297d28Sopenharmony_ci    "-Werror",
29e9297d28Sopenharmony_ci    "-g3",
30e9297d28Sopenharmony_ci    "-fdata-sections",
31e9297d28Sopenharmony_ci    "-ffunction-sections",
32e9297d28Sopenharmony_ci    "-fno-asynchronous-unwind-tables",
33e9297d28Sopenharmony_ci    "-fno-unwind-tables",
34e9297d28Sopenharmony_ci    "-Os",
35e9297d28Sopenharmony_ci  ]
36e9297d28Sopenharmony_ci
37e9297d28Sopenharmony_ci  defines = []
38e9297d28Sopenharmony_ci  defines += gpu_defines
39e9297d28Sopenharmony_ci  if (player_framework_enable) {
40e9297d28Sopenharmony_ci    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
41e9297d28Sopenharmony_ci  }
42e9297d28Sopenharmony_ci
43e9297d28Sopenharmony_ci  if (defined(use_rosen_drawing) && use_rosen_drawing) {
44e9297d28Sopenharmony_ci    defines += [ "USE_ROSEN_DRAWING" ]
45e9297d28Sopenharmony_ci  }
46e9297d28Sopenharmony_ci}
47e9297d28Sopenharmony_ci
48e9297d28Sopenharmony_ciohos_executable("bootanimation") {
49e9297d28Sopenharmony_ci  install_enable = true
50e9297d28Sopenharmony_ci
51e9297d28Sopenharmony_ci  sources = [
52e9297d28Sopenharmony_ci    "src/boot_animation_controller.cpp",
53e9297d28Sopenharmony_ci    "src/boot_animation_operation.cpp",
54e9297d28Sopenharmony_ci    "src/boot_animation_strategy.cpp",
55e9297d28Sopenharmony_ci    "src/boot_associative_display_strategy.cpp",
56e9297d28Sopenharmony_ci    "src/boot_compatible_display_strategy.cpp",
57e9297d28Sopenharmony_ci    "src/boot_compile_progress.cpp",
58e9297d28Sopenharmony_ci    "src/boot_independent_display_strategy.cpp",
59e9297d28Sopenharmony_ci    "src/boot_picture_player.cpp",
60e9297d28Sopenharmony_ci    "src/boot_sound_player.cpp",
61e9297d28Sopenharmony_ci    "src/boot_video_player.cpp",
62e9297d28Sopenharmony_ci    "src/main.cpp",
63e9297d28Sopenharmony_ci    "src/util.cpp",
64e9297d28Sopenharmony_ci  ]
65e9297d28Sopenharmony_ci
66e9297d28Sopenharmony_ci  configs = [ ":bootanimation_config" ]
67e9297d28Sopenharmony_ci
68e9297d28Sopenharmony_ci  deps = [
69e9297d28Sopenharmony_ci    "$graphic_2d_root:libbootanimation_utils",
70e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics",
71e9297d28Sopenharmony_ci    "$graphic_2d_root/rosen/modules/render_service_client:librender_service_client",
72e9297d28Sopenharmony_ci  ]
73e9297d28Sopenharmony_ci
74e9297d28Sopenharmony_ci  external_deps = [
75e9297d28Sopenharmony_ci    "cJSON:cjson_static",
76e9297d28Sopenharmony_ci    "c_utils:utils",
77e9297d28Sopenharmony_ci    "config_policy:configpolicy_util",
78e9297d28Sopenharmony_ci    "eventhandler:libeventhandler",
79e9297d28Sopenharmony_ci    "hilog:libhilog",
80e9297d28Sopenharmony_ci    "hitrace:hitrace_meter",
81e9297d28Sopenharmony_ci    "ipc:ipc_core",
82e9297d28Sopenharmony_ci    "samgr:samgr_proxy",
83e9297d28Sopenharmony_ci    "skia:skia_canvaskit",
84e9297d28Sopenharmony_ci    "zlib:libz",
85e9297d28Sopenharmony_ci  ]
86e9297d28Sopenharmony_ci
87e9297d28Sopenharmony_ci  if (player_framework_enable) {
88e9297d28Sopenharmony_ci    external_deps += [ "player_framework:media_client" ]
89e9297d28Sopenharmony_ci  }
90e9297d28Sopenharmony_ci
91e9297d28Sopenharmony_ci  if (is_standard_system) {
92e9297d28Sopenharmony_ci    external_deps += [ "init:libbegetutil" ]
93e9297d28Sopenharmony_ci  } else {
94e9297d28Sopenharmony_ci    external_deps += [ "startup:syspara" ]
95e9297d28Sopenharmony_ci  }
96e9297d28Sopenharmony_ci
97e9297d28Sopenharmony_ci  part_name = "graphic_2d"
98e9297d28Sopenharmony_ci  subsystem_name = "graphic"
99e9297d28Sopenharmony_ci
100e9297d28Sopenharmony_ci  sanitize = {
101e9297d28Sopenharmony_ci    cfi = true
102e9297d28Sopenharmony_ci    cfi_cross_dso = true
103e9297d28Sopenharmony_ci    debug = false
104e9297d28Sopenharmony_ci    cfi_vcall_icall_only = true
105e9297d28Sopenharmony_ci    integer_overflow = true
106e9297d28Sopenharmony_ci    ubsan = true
107e9297d28Sopenharmony_ci    boundary_sanitize = true
108e9297d28Sopenharmony_ci  }
109e9297d28Sopenharmony_ci  branch_protector_ret = "pac_ret"
110e9297d28Sopenharmony_ci}
111e9297d28Sopenharmony_ci
112e9297d28Sopenharmony_ci## Build bootanimation }}}
113e9297d28Sopenharmony_ci
114e9297d28Sopenharmony_ci## Install boot animation resource to /system/etc/graphic/ {{{
115e9297d28Sopenharmony_ciohos_prebuilt_etc("bootanimation_pics") {
116e9297d28Sopenharmony_ci  source = "data/bootpic.zip"
117e9297d28Sopenharmony_ci  relative_install_dir = "graphic"
118e9297d28Sopenharmony_ci  part_name = "graphic_2d"
119e9297d28Sopenharmony_ci  subsystem_name = "graphic"
120e9297d28Sopenharmony_ci}
121e9297d28Sopenharmony_ci
122e9297d28Sopenharmony_ciohos_prebuilt_etc("bootanimation_sounds") {
123e9297d28Sopenharmony_ci  source = "data/bootsound.wav"
124e9297d28Sopenharmony_ci  relative_install_dir = "graphic"
125e9297d28Sopenharmony_ci  part_name = "graphic_2d"
126e9297d28Sopenharmony_ci  subsystem_name = "graphic"
127e9297d28Sopenharmony_ci}
128e9297d28Sopenharmony_ci
129e9297d28Sopenharmony_ciohos_prebuilt_etc("bootanimation_video") {
130e9297d28Sopenharmony_ci  source = "data/bootvideo.mp4"
131e9297d28Sopenharmony_ci  relative_install_dir = "graphic"
132e9297d28Sopenharmony_ci  part_name = "graphic_2d"
133e9297d28Sopenharmony_ci  subsystem_name = "graphic"
134e9297d28Sopenharmony_ci}
135e9297d28Sopenharmony_ci
136e9297d28Sopenharmony_ci## Install boot animation resource to /system/etc/graphic/ }}}
137e9297d28Sopenharmony_ci
138e9297d28Sopenharmony_ci## Install boot animation para to /system/etc/param/ {{{
139e9297d28Sopenharmony_ciohos_prebuilt_etc("bootanimation_para") {
140e9297d28Sopenharmony_ci  source = "etc/bootanimation.para"
141e9297d28Sopenharmony_ci  relative_install_dir = "param"
142e9297d28Sopenharmony_ci  part_name = "graphic_2d"
143e9297d28Sopenharmony_ci  subsystem_name = "graphic"
144e9297d28Sopenharmony_ci}
145e9297d28Sopenharmony_ci## Install boot animation para to /system/etc/param/ }}}
146