Alexander Williams | 419f846 | 2022-11-07 14:37:08 -0800 | [diff] [blame] | 1 | # Copyright lowRISC contributors. |
| 2 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | """Transition rules for accessing the host platform |
| 6 | |
| 7 | This file contains transition rules for accessing the host platform's |
| 8 | configuration. Primarily, this provides transitions for rules where a tool runs |
| 9 | on the host but the target configuration is not the host. For rules where |
| 10 | the host configuration is not adequate, toolchains should be used instead. |
| 11 | """ |
| 12 | |
| 13 | def _host_tools_transition_impl(settings, attr): |
| 14 | """Returns a dictionary with the platforms command line option set to host. |
| 15 | |
| 16 | This transition is used for building host tools, passing through all build |
| 17 | settings specified on the command line. |
| 18 | """ |
| 19 | return {"//command_line_option:platforms": "@local_config_platform//:host"} |
| 20 | |
| 21 | host_tools_transition = transition( |
| 22 | implementation = _host_tools_transition_impl, |
| 23 | inputs = [], |
| 24 | outputs = ["//command_line_option:platforms"], |
| 25 | ) |