# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (current_cpu == "arm" || current_cpu == "arm64") { import("$build_root/config/arm.gni") } if (current_cpu == "arm" || current_cpu == "arm64") { import("$build_root/config/arm.gni") } is_ohos_or_android = is_ohos || is_android optimize_for_size = is_ohos_or_android declare_args() { # Set to true to use lld, the LLVM linker. This flag may be used on Windows, # Linux. use_lld = is_clang && (is_win || (is_linux && current_cpu == "x64") || (is_linux && current_cpu == "x86") || (is_ohos_or_android && (current_cpu != "arm" || arm_version >= 7))) } declare_args() { # Whether to use the gold linker from binutils instead of lld or bfd. use_gold = !use_lld && ((is_linux && (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm")) || (is_ohos_or_android && (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" || current_cpu == "arm64"))) }