1# Copyright (c) 2024 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/config/clang/clang.gni") 15import("//build/ohos.gni") 16 17group("libcpp_install") { 18 deps = [ ":libc++_shared.so" ] 19} 20 21ohos_prebuilt_shared_library("libc++_shared.so") { 22 enable_strip = true 23 mini_debug = true 24 if (target_cpu == "arm") { 25 source = "${clang_stl_path}/arm-linux-ohos/libc++_shared.so" 26 } else if (target_cpu == "arm64") { 27 source = "${clang_stl_path}/aarch64-linux-ohos/libc++_shared.so" 28 } else if (target_cpu == "x86_64") { 29 source = "${clang_stl_path}/x86_64-linux-ohos/libc++_shared.so" 30 } else { 31 source = "" 32 } 33 deps = [ ":libcpp_unstripped_copy" ] 34 install_images = [ "system" ] 35 subsystem_name = "build" 36 part_name = "build_framework" 37 relative_install_dir = "" 38} 39 40copy("libcpp_unstripped_copy") { 41 if (target_cpu == "arm") { 42 sources = [ "${clang_stl_path}/arm-linux-ohos/libc++_shared.so" ] 43 } else if (target_cpu == "arm64") { 44 sources = [ "${clang_stl_path}/aarch64-linux-ohos/libc++_shared.so" ] 45 } else if (target_cpu == "x86_64") { 46 sources = [ "${clang_stl_path}/x86_64-linux-ohos/libc++_shared.so" ] 47 } else { 48 sources = [ "" ] 49 } 50 outputs = [ root_out_dir + "/lib.unstripped/clang/{{source_file_part}}" ] 51} 52