| # Copyright lowRISC contributors. |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| load("@bazel_skylib//lib:selects.bzl", "selects") |
| load("@bazel_skylib//rules:common_settings.bzl", "string_flag") |
| load("//rules:matcha.bzl", "OPENTITAN_PLATFORM") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| config_setting( |
| name = "opentitan_platform", |
| values = {"platforms": OPENTITAN_PLATFORM}, |
| ) |
| |
| config_setting( |
| name = "sparrow_platform_internal", |
| values = {"platforms": "//platforms/riscv32:sparrow"}, |
| ) |
| |
| config_setting( |
| name = "sparrow_platform_external", |
| values = {"platforms": "@matcha//platforms/riscv32:sparrow"}, |
| ) |
| |
| selects.config_setting_group( |
| name = "sparrow_platform", |
| match_any = [ |
| ":sparrow_platform_internal", |
| ":sparrow_platform_external", |
| ], |
| ) |
| |
| string_flag( |
| name = "build_env", |
| build_setting_default = "", |
| ) |
| |
| config_setting( |
| name = "airgapped_env", |
| flag_values = { |
| ":build_env": "airgapped", |
| }, |
| ) |