Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / build / config / arm.gni
1 # Copyright (c) 2020 Project CHIP Authors
2 #
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
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 import("//build_overrides/build.gni")
16
17 if ((current_cpu == "arm" || current_cpu == "arm64") &&
18     (current_os != "mac" && current_os != "ios")) {
19   declare_args() {
20     # Build file to import for ARM defaults.
21     arm_platform_config = ""
22   }
23
24   if (arm_platform_config == "") {
25     if (current_os == "android") {
26       arm_platform_config = "${build_root}/toolchain/android/android_arm.gni"
27     }
28   }
29
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)
35     }
36   }
37
38   _defaults = {
39     arm_arch = ""
40     arm_cpu = ""
41     arm_tune = ""
42     arm_fpu = ""
43     arm_float_abi = ""
44     arm_abi = ""
45     arm_use_thumb = current_os != "linux" &&
46                     (current_os != "android" || current_cpu != "arm64")
47
48     # Update defaults with platform values, if any.
49     if (arm_platform_config != "") {
50       forward_variables_from(_platform_defaults, "*")
51     }
52   }
53
54   declare_args() {
55     # ARM architecture (value for -march flag).
56     arm_arch = _defaults.arm_arch
57
58     # ARM CPU (value for -mcpu flag).
59     arm_cpu = _defaults.arm_cpu
60
61     # ARM tuning (value for -mtune flag).
62     arm_tune = _defaults.arm_tune
63
64     # ARM FPU (value for -mfpu flag).
65     arm_fpu = _defaults.arm_fpu
66
67     # ARM float ABI (value for -mfloat-abi flag).
68     arm_float_abi = _defaults.arm_float_abi
69
70     # ARM ABI (value for -mabi flag).
71     arm_abi = _defaults.arm_abi
72
73     # ARM thumb instruction set (value for -mthumb flag).
74     arm_use_thumb = _defaults.arm_use_thumb
75   }
76 }