| # Copyright (c) 2020 Project CHIP Authors |
| # |
| # 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 == "x86" || current_cpu == "x86_64") { |
| declare_args() { |
| # Build file to import for X86 defaults. |
| x86_platform_config = "" |
| } |
| |
| # Allow platforms to override how ARM architecture flags are chosen by |
| # providing a file to import. |
| if (x86_platform_config != "") { |
| _platform_defaults = { |
| import(x86_platform_config) |
| } |
| } |
| |
| _defaults = { |
| x86_arch = "" |
| x86_cpu = "" |
| x86_tune = "" |
| |
| # Update defaults with platform values, if any. |
| if (x86_platform_config != "") { |
| forward_variables_from(_platform_defaults, "*") |
| } |
| } |
| |
| declare_args() { |
| # ARM architecture (value for -march flag). |
| x86_arch = _defaults.x86_arch |
| |
| # ARM CPU (value for -mcpu flag). |
| x86_cpu = _defaults.x86_cpu |
| |
| # ARM tuning (value for -mtune flag). |
| x86_tune = _defaults.x86_tune |
| } |
| } |