1# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5if (is_ohos) {
6  import("//build/config/clang/clang.gni")
7  import("//build/misc/overrides/build.gni")
8  import("abi.gni")
9
10  import("//build/config/ohos/musl.gni")
11
12  default_base_libs_root = ""
13
14  declare_args() {
15    base_libs_root = default_base_libs_root
16  }
17
18  # Defines the name the ohos build gives to the current host CPU
19  # architecture, which is different than the names GN uses.
20  if (host_os == "linux") {
21    ohos_host_os = "linux"
22  } else if (host_os == "mac") {
23    ohos_host_os = "darwin"
24  } else {
25    assert(false, "Need toolchain support for your build OS.")
26  }
27
28  if (current_cpu == "arm") {
29    abi_target = "arm-linux-ohos"
30  } else if (current_cpu == "x86") {
31    abi_target = ""
32  } else if (current_cpu == "arm64") {
33    abi_target = "aarch64-linux-ohos"
34  } else if (current_cpu == "x86_64") {
35    abi_target = "x86_64-linux-ohos"
36  } else if (current_cpu == "riscv64") {
37    abi_target = "riscv64-linux-ohos"
38  } else if (current_cpu == "mipsel") {
39    abi_target = "mipsel-linux-ohos"
40  } else if (current_cpu == "loongarch64") {
41    abi_target = "loongarch64-linux-ohos"
42  } else {
43    assert(false, "Architecture not supported")
44  }
45  if (current_cpu == "arm64") {
46    libgwp_asan_file = "${clang_base_path}/lib/clang/${clang_version}/lib/${abi_target}/libclang_rt.gwp_asan.a"
47  }
48  libclang_rt_file = "${clang_base_path}/lib/clang/${clang_version}/lib/${abi_target}/libclang_rt.builtins.a"
49  libcxxabi_file = "${clang_base_path}/lib/${abi_target}/libc++abi.a"
50  libcxx_ndk_shared_file =
51      "${clang_base_path}/../libcxx-ndk/lib/${abi_target}/libc++_shared.so"
52}
53