• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020 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.
13import("//build/lite/toolchain/clang.gni")
14import("//build/lite/toolchain/gcc.gni")
15import("//build/lite/toolchain/iccarm.gni")
16
17# Set toolchain configured by board.
18if (board_toolchain != "" && use_board_toolchain) {
19  if (board_toolchain_type == "gcc") {
20    gcc_toolchain(board_toolchain) {
21      cc = ohos_current_cc_command
22      cxx = ohos_current_cxx_command
23      ar = ohos_current_ar_command
24      ld = ohos_current_ld_command
25      strip = ohos_current_strip_command
26    }
27  } else if (board_toolchain_type == "clang") {
28    clang_toolchain(board_toolchain) {
29      cc = ohos_current_cc_command
30      cxx = ohos_current_cxx_command
31      ar = ohos_current_ar_command
32      ld = ohos_current_ld_command
33      strip = ohos_current_strip_command
34    }
35  } else if (board_toolchain_type == "iccarm") {
36    iccarm_toolchain(board_toolchain) {
37      cc = ohos_current_cc_command
38      cxx = ohos_current_cxx_command
39      as = ohos_current_as_command
40      ar = ohos_current_ar_command
41      ld = ohos_current_ld_command
42      strip = ohos_current_strip_command
43    }
44  }
45} else {
46  clang_toolchain("linux_x86_64_ohos_clang") {
47    cc = ohos_current_cc_command
48    cxx = ohos_current_cxx_command
49    ar = ohos_current_ar_command
50    ld = ohos_current_ld_command
51    strip = ohos_current_strip_command
52  }
53}
54