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") 15 16# Set toolchain configed by board. 17if (board_toolchain != "" && use_board_toolchain) { 18 if (board_toolchain_type == "gcc") { 19 gcc_toolchain(board_toolchain) { 20 cc = ohos_current_cc_command 21 cxx = ohos_current_cxx_command 22 ar = ohos_current_ar_command 23 ld = ohos_current_ld_command 24 strip = ohos_current_strip_command 25 } 26 } else if (board_toolchain_type == "clang") { 27 clang_toolchain(board_toolchain) { 28 cc = ohos_current_cc_command 29 cxx = ohos_current_cxx_command 30 ar = ohos_current_ar_command 31 ld = ohos_current_ld_command 32 strip = ohos_current_strip_command 33 } 34 } 35} else { 36 clang_toolchain("linux_x86_64_ohos_clang") { 37 cc = ohos_current_cc_command 38 cxx = ohos_current_cxx_command 39 ar = ohos_current_ar_command 40 ld = ohos_current_ld_command 41 strip = ohos_current_strip_command 42 } 43} 44