mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:30:14 +01:00
I've had these kicking around for a year but never got around to pushing them. They seem to cover a few things that previous examples didn't, so I think we may as well include them. --------- Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
30 lines
901 B
Python
30 lines
901 B
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
load("//bazel/carbon_rules:defs.bzl", "carbon_binary")
|
|
|
|
utils = [
|
|
"io_utils.carbon",
|
|
"sort.carbon",
|
|
]
|
|
|
|
# A list of examples that should be excluded because they don't build any more.
|
|
# For example, to exclude day3_part2, use:
|
|
# excluded = ["day3_part2.carbon"]
|
|
excluded = []
|
|
|
|
# Produce a binary `dayX_partY` for each matching `.carbon` file. Each binary
|
|
# depends on `dayX_partY.carbon` and `dayX_common.carbon`.
|
|
[
|
|
carbon_binary(
|
|
name = carbon_file.removesuffix(".carbon"),
|
|
srcs = [
|
|
carbon_file,
|
|
carbon_file.rsplit("_", 1)[0] + "_common.carbon",
|
|
] + utils,
|
|
)
|
|
for carbon_file in glob(["day*_part*.carbon"])
|
|
if carbon_file not in excluded
|
|
]
|