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 13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19# SOFTWARE. 20import("//build/ohos.gni") 21import("//build/config/clang/clang.gni") 22import("dependency_inputs.gni") 23mesa3d_libs_dir = "$root_build_dir/packages/phone/mesa3d" 24 25mesa3d_gallium_symlinks = ["panfrost_dri.so"] 26 27mesa3d_all_lib_items = [ 28 ["libEGL.so.1.0.0", ["libEGL.so", "libEGL.so.1"]], 29 ["libgbm.so.1.0.0", ["libgbm.so", "libgbm.so.1"]], 30 ["libglapi.so.0.0.0", ["libglapi.so", "libglapi.so.0"]], 31 ["libGLESv1_CM.so.1.1.0", ["libGLESv1_CM.so", "libGLESv1_CM.so.1"]], 32 ["libGLESv2.so.2.0.0", ["libGLESv2.so", "libGLESv2.so.2", "libGLESv3.so"]], 33 ["libgallium_dri.so", mesa3d_gallium_symlinks] 34] 35 36action("mesa3d_build") { 37 inputs = deps_inputs 38 script = "build_mesa3d.py" 39 deps = [ 40 "//foundation/graphic/graphic_2d:libsurface", 41 "//third_party/expat:expat", 42 ] 43 outputs = [] 44 foreach(item, mesa3d_all_lib_items) { 45 name = item[0] 46 outputs += [ "$mesa3d_libs_dir/$name" ] 47 } 48 args = [ rebase_path(root_build_dir) ] 49} 50 51mesa3d_all_lib_deps = [] 52 53foreach(item, mesa3d_all_lib_items) { 54 name = item[0] 55 ohos_prebuilt_shared_library(name) { 56 source = "$mesa3d_libs_dir/$name" 57 deps = [ ":mesa3d_build" ] 58 symlink_target_name = item[1] 59 install_enable = true 60 install_images = [ system_base_dir ] 61 subsystem_name = "rockchip_products" 62 part_name = "rockchip_products" 63 } 64 mesa3d_all_lib_deps += [ ":$name" ] 65} 66 67group("mesa3d_all_libs"){ 68 deps = mesa3d_all_lib_deps 69} 70