Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / build / config / x86.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 if (current_cpu == "x86" || current_cpu == "x86_64") {
16   declare_args() {
17     # Build file to import for X86 defaults.
18     x86_platform_config = ""
19   }
20
21   # Allow platforms to override how ARM architecture flags are chosen by
22   # providing a file to import.
23   if (x86_platform_config != "") {
24     _platform_defaults = {
25       import(x86_platform_config)
26     }
27   }
28
29   _defaults = {
30     x86_arch = ""
31     x86_cpu = ""
32     x86_tune = ""
33
34     # Update defaults with platform values, if any.
35     if (x86_platform_config != "") {
36       forward_variables_from(_platform_defaults, "*")
37     }
38   }
39
40   declare_args() {
41     # ARM architecture (value for -march flag).
42     x86_arch = _defaults.x86_arch
43
44     # ARM CPU (value for -mcpu flag).
45     x86_cpu = _defaults.x86_cpu
46
47     # ARM tuning (value for -mtune flag).
48     x86_tune = _defaults.x86_tune
49   }
50 }