1# Copyright (c) 2022 Unionman Technology 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("//build/ohos/ndk/ndk.gni") 16 17config("mesa3d-common_config") { 18} 19 20ohos_prebuilt_shared_library("libgbm.so.1") { 21 if (target_cpu == "arm") { 22 source = "lib/libgbm.so.1" 23 } else if (target_cpu == "arm64") { 24 source = "lib64/libgbm.so.1" 25 } 26 install_images = [ chipset_base_dir ] 27 relative_install_dir = "chipsetsdk" 28 29 part_name = "device_unionpi_tiger" 30 install_enable = true 31 public_configs = [ ":mesa3d-common_config" ] 32} 33 34ohos_prebuilt_shared_library("libEGL.so.1") { 35 if (target_cpu == "arm") { 36 source = "lib/libEGL.so.1" 37 } else if (target_cpu == "arm64") { 38 source = "lib64/libEGL.so.1" 39 } 40 install_images = [ chipset_base_dir ] 41 relative_install_dir = "chipsetsdk" 42 symlink_target_name = [ 43 "libEGL.so", 44 "libEGL_impl.so", 45 ] 46 47 part_name = "device_unionpi_tiger" 48 install_enable = true 49 public_configs = [ ":mesa3d-common_config" ] 50} 51 52ohos_prebuilt_shared_library("libglapi.so.0") { 53 if (target_cpu == "arm") { 54 source = "lib/libglapi.so.0" 55 } else if (target_cpu == "arm64") { 56 source = "lib64/libglapi.so.0" 57 } 58 install_images = [ chipset_base_dir ] 59 relative_install_dir = "chipsetsdk" 60 61 part_name = "device_unionpi_tiger" 62 install_enable = true 63 public_configs = [ ":mesa3d-common_config" ] 64} 65 66ohos_prebuilt_shared_library("libGLESv1_CM.so.1") { 67 if (target_cpu == "arm") { 68 source = "lib/libGLESv1_CM.so.1" 69 } else if (target_cpu == "arm64") { 70 source = "lib64/libGLESv1_CM.so.1" 71 } 72 install_images = [ chipset_base_dir ] 73 relative_install_dir = "chipsetsdk" 74 symlink_target_name = [ 75 "libGLESv1.so", 76 "libGLESv1_impl.so", 77 ] 78 79 part_name = "device_unionpi_tiger" 80 install_enable = true 81 public_configs = [ ":mesa3d-common_config" ] 82} 83 84ohos_prebuilt_shared_library("libGLESv2.so.2") { 85 if (target_cpu == "arm") { 86 source = "lib/libGLESv2.so.2" 87 } else if (target_cpu == "arm64") { 88 source = "lib64/libGLESv2.so.2" 89 } 90 install_images = [ chipset_base_dir ] 91 relative_install_dir = "chipsetsdk" 92 symlink_target_name = [ 93 "libGLESv2.so", 94 "libGLESv2_impl.so", 95 "libGLESv3.so", 96 "libGLESv3_impl.so", 97 ] 98 99 part_name = "device_unionpi_tiger" 100 install_enable = true 101 public_configs = [ ":mesa3d-common_config" ] 102} 103 104group("mesa3d-panforst-ohos") { 105 deps = [ 106 ":libEGL.so.1", 107 ":libGLESv1_CM.so.1", 108 ":libGLESv2.so.2", 109 ":libgbm.so.1", 110 ":libglapi.so.0", 111 ] 112} 113 114ohos_prebuilt_shared_library("libgallium_dri.so") { 115 if (target_cpu == "arm") { 116 source = "lib/libgallium_dri.so" 117 } else if (target_cpu == "arm64") { 118 source = "lib64/libgallium_dri.so" 119 } 120 install_enable = true 121 install_images = [ chipset_base_dir ] 122 relative_install_dir = "chipsetsdk" 123 symlink_target_name = [ 124 "panfrost_dri.so", 125 "meson_dri.so", 126 ] 127 128 part_name = "device_unionpi_tiger" 129} 130 131ohos_prebuilt_etc("gpu-sched.ko") { 132 source = "modules/gpu-sched.ko" 133 module_install_dir = "modules" 134 install_images = [ chipset_base_dir ] 135 136 part_name = "device_unionpi_tiger" 137} 138 139ohos_prebuilt_etc("panfrost.ko") { 140 source = "modules/panfrost.ko" 141 module_install_dir = "modules" 142 install_images = [ chipset_base_dir ] 143 144 part_name = "device_unionpi_tiger" 145} 146 147group("gpu") { 148 deps = [ 149 ":gpu-sched.ko", 150 ":libgallium_dri.so", 151 ":mesa3d-panforst-ohos", 152 ":panfrost.ko", 153 ] 154} 155