blob: c35285c1f6463900adc1654a2f977d3fdc0091a8 [file] [log] [blame]
Alexander Williams419f8462022-11-07 14:37:08 -08001# 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
7This file contains transition rules for accessing the host platform's
8configuration. Primarily, this provides transitions for rules where a tool runs
9on the host but the target configuration is not the host. For rules where
10the host configuration is not adequate, toolchains should be used instead.
11"""
12
13def _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
21host_tools_transition = transition(
22 implementation = _host_tools_transition_impl,
23 inputs = [],
24 outputs = ["//command_line_option:platforms"],
25)