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") 23mesa3d_libs_dir = "$root_build_dir/packages/phone/mesa3d" 24 25mesa3d_gallium_symlinks = [ "panfrost_dri.so" ] 26 27mesa3d_all_lib_items = [ 28 [ 29 "libEGL.so.1.0.0", 30 [ 31 "libEGL.so", 32 "libEGL.so.1", 33 "libEGL_impl.so", 34 ], 35 ], 36 [ 37 "libgbm.so.1.0.0", 38 [ 39 "libgbm.so", 40 "libgbm.so.1", 41 ], 42 ], 43 [ 44 "libglapi.so.0.0.0", 45 [ 46 "libglapi.so", 47 "libglapi.so.0", 48 ], 49 ], 50 [ 51 "libGLESv1_CM.so.1.1.0", 52 [ 53 "libGLESv1_CM.so", 54 "libGLESv1_CM.so.1", 55 "libGLESv1_impl.so", 56 ], 57 ], 58 [ 59 "libGLESv2.so.2.0.0", 60 [ 61 "libGLESv2.so", 62 "libGLESv2.so.2", 63 "libGLESv3.so", 64 "libGLESv2_impl.so", 65 "libGLESv3_impl.so", 66 ], 67 ], 68 [ 69 "libgallium_dri.so", 70 mesa3d_gallium_symlinks, 71 ], 72] 73 74action("mesa3d_build") { 75 script = "build_mesa3d.py" 76 deps = [ 77 "//foundation/graphic/graphic_2d:libsurface", 78 "//third_party/expat:expat", 79 ] 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