• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 libcomposer.so
18
19config("composer_config") {
20  visibility = [ ":*" ]
21
22  cflags = [
23    "-Wall",
24    "-Werror",
25    "-g3",
26  ]
27  if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64")) {
28    cflags += [ "-flto=thin" ]
29  }
30}
31
32config("composer_public_config") {
33  include_dirs = [
34    "$graphic_2d_root/rosen/include/common",
35    "//drivers/peripheral/display/interfaces/include",
36    "$graphic_2d_root/interfaces/inner_api/common",
37    "$graphic_2d_root/rosen/modules/composer/hdi_backend/include",
38    "$graphic_2d_root/rosen/modules/composer/vsync/include",
39    "$graphic_2d_root/interfaces/inner_api/composer",
40  ]
41}
42
43ohos_shared_library("libcomposer") {
44  sources = [
45    "hdi_backend/src/hdi_backend.cpp",
46    "hdi_backend/src/hdi_device.cpp",
47    "hdi_backend/src/hdi_device_impl.cpp",
48    "hdi_backend/src/hdi_framebuffer_surface.cpp",
49    "hdi_backend/src/hdi_layer.cpp",
50    "hdi_backend/src/hdi_output.cpp",
51    "hdi_backend/src/hdi_screen.cpp",
52  ]
53
54  include_dirs = [
55    "$graphic_2d_root/frameworks/surface/include",
56    "$graphic_2d_root/utils/log",
57  ]
58
59  configs = [ ":composer_config" ]
60
61  defines = []
62  defines += gpu_defines
63
64  public_configs = [
65    ":composer_public_config",
66    "//commonlibrary/c_utils/base:utils_config",
67  ]
68
69  deps = [ "$graphic_2d_root:libsurface" ]
70
71  public_deps = [
72    "$graphic_2d_root/utils:buffer_handle",
73    "$graphic_2d_root/utils:scoped_bytrace",
74    "$graphic_2d_root/utils:sync_fence",
75    "vsync:libvsync",
76  ]
77
78  external_deps = [
79    "c_utils:utils",
80    "hilog:libhilog",
81    "hitrace:hitrace_meter",
82    "ipc:ipc_core",
83  ]
84
85  if (graphic_2d_feature_drivers_interface_display_enable) {
86    external_deps += [
87      "drivers_interface_display:display_buffer_idl_headers",
88      "drivers_interface_display:display_commontype_idl_headers",
89      "drivers_interface_display:display_composer_idl_headers_1.1",
90      "drivers_interface_display:libdisplay_composer_hdi_impl_1.1",
91    ]
92    defines += [ "DRIVERS_INTERFACE_DISPLAY_ENABLE" ]
93  }
94
95  part_name = "graphic_2d"
96  subsystem_name = "graphic"
97}
98
99## Build libcomposer.so
100
101group("test") {
102  testonly = true
103
104  deps = [
105    "hdi_backend/test:test",
106    "vsync/test:test",
107  ]
108}
109