• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.
2
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
13import("//build/config/clang/clang.gni")
14
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE.
22import("//build/ohos.gni")
23import("dependency_inputs.gni")
24mesa3d_libs_dir = "$root_build_dir/packages/phone/mesa3d"
25
26mesa3d_gallium_symlinks = [ "panfrost_dri.so" ]
27
28mesa3d_all_lib_items = [
29  [
30    "libEGL.so.1.0.0",
31    [
32      "libEGL.so",
33      "libEGL.so.1",
34      "libEGL_impl.so",
35    ],
36  ],
37  [
38    "libgbm.so.1.0.0",
39    [
40      "libgbm.so",
41      "libgbm.so.1",
42    ],
43  ],
44  [
45    "libglapi.so.0.0.0",
46    [
47      "libglapi.so",
48      "libglapi.so.0",
49    ],
50  ],
51  [
52    "libGLESv1_CM.so.1.1.0",
53    [
54      "libGLESv1_CM.so",
55      "libGLESv1_CM.so.1",
56      "libGLESv1_impl.so",
57    ],
58  ],
59  [
60    "libGLESv2.so.2.0.0",
61    [
62      "libGLESv2.so",
63      "libGLESv2.so.2",
64      "libGLESv3.so",
65      "libGLESv2_impl.so",
66      "libGLESv3_impl.so",
67    ],
68  ],
69  [
70    "libgallium_dri.so",
71    mesa3d_gallium_symlinks,
72  ],
73]
74
75action("mesa3d_build") {
76  inputs = deps_inputs
77  script = "build_mesa3d.py"
78  deps = [ "//third_party/expat:expat" ]
79  external_deps = [ "graphic_surface:surface" ]
80  outputs = []
81  foreach(item, mesa3d_all_lib_items) {
82    name = item[0]
83    outputs += [ "$mesa3d_libs_dir/$name" ]
84  }
85  args = [ rebase_path(root_build_dir) ]
86}
87
88mesa3d_all_lib_deps = []
89
90foreach(item, mesa3d_all_lib_items) {
91  name = item[0]
92  ohos_prebuilt_shared_library(name) {
93    source = "$mesa3d_libs_dir/$name"
94    deps = [ ":mesa3d_build" ]
95    symlink_target_name = item[1]
96    install_enable = true
97    install_images = [ system_base_dir ]
98    subsystem_name = "rockchip_products"
99    part_name = "rockchip_products"
100  }
101  mesa3d_all_lib_deps += [ ":$name" ]
102}
103
104group("mesa3d_all_libs") {
105  deps = mesa3d_all_lib_deps
106}
107