• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 (use_hwasan == false && 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 if (is_asan == true && use_hwasan == true && target_cpu == "arm64") {
31    source = "${clang_stl_path}/aarch64-linux-ohos/hwasan/libc++_shared.so"
32  } else {
33    source = ""
34  }
35  deps = [ ":libcpp_unstripped_copy" ]
36  install_images = [ "system" ]
37  subsystem_name = "build"
38  part_name = "build_framework"
39  innerapi_tags = [ "chipsetsdk_sp" ]
40  relative_install_dir = ""
41}
42
43copy("libcpp_unstripped_copy") {
44  if (target_cpu == "arm") {
45    sources = [ "${clang_stl_path}/arm-linux-ohos/libc++_shared.so" ]
46  } else if (target_cpu == "arm64") {
47    sources = [ "${clang_stl_path}/aarch64-linux-ohos/libc++_shared.so" ]
48  } else if (target_cpu == "x86_64") {
49    sources = [ "${clang_stl_path}/x86_64-linux-ohos/libc++_shared.so" ]
50  } else {
51    sources = [ "" ]
52  }
53  outputs = [ root_out_dir + "/lib.unstripped/clang/{{source_file_part}}" ]
54}
55