1 # Copyright (c) 2020 Project CHIP Authors
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 import("//build_overrides/build.gni")
17 if ((current_cpu == "arm" || current_cpu == "arm64") &&
18 (current_os != "mac" && current_os != "ios")) {
20 # Build file to import for ARM defaults.
21 arm_platform_config = ""
24 if (arm_platform_config == "") {
25 if (current_os == "android") {
26 arm_platform_config = "${build_root}/toolchain/android/android_arm.gni"
30 # Allow platforms to override how ARM architecture flags are chosen by
31 # providing a file to import.
32 if (arm_platform_config != "") {
33 _platform_defaults = {
34 import(arm_platform_config)
45 arm_use_thumb = current_os != "linux" &&
46 (current_os != "android" || current_cpu != "arm64")
48 # Update defaults with platform values, if any.
49 if (arm_platform_config != "") {
50 forward_variables_from(_platform_defaults, "*")
55 # ARM architecture (value for -march flag).
56 arm_arch = _defaults.arm_arch
58 # ARM CPU (value for -mcpu flag).
59 arm_cpu = _defaults.arm_cpu
61 # ARM tuning (value for -mtune flag).
62 arm_tune = _defaults.arm_tune
64 # ARM FPU (value for -mfpu flag).
65 arm_fpu = _defaults.arm_fpu
67 # ARM float ABI (value for -mfloat-abi flag).
68 arm_float_abi = _defaults.arm_float_abi
70 # ARM ABI (value for -mabi flag).
71 arm_abi = _defaults.arm_abi
73 # ARM thumb instruction set (value for -mthumb flag).
74 arm_use_thumb = _defaults.arm_use_thumb