mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 13:50:10 +01:00
It's come up that `carbon_library` better represents a linkage unit instead of having to closely mirror the Carbon language library concept. Given that we can have more than one API file in a linkage unit, and that `srcs` and `hdrs` gives better compatibility with other C++ tooling, this PR switches `impls` and `api` back to `srcs` and `hdrs`, and fixes up the broken code.
66 lines
1.5 KiB
Python
66 lines
1.5 KiB
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_library")
|
|
load("//bazel/manifest:defs.bzl", "manifest")
|
|
|
|
# Raw prelude files.
|
|
filegroup(
|
|
name = "prelude_files",
|
|
srcs = ["prelude.carbon"] + glob(["prelude/**/*.carbon"]),
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# A list of prelude inputs.
|
|
# This is consumed by //toolchain/base:install_paths.
|
|
manifest(
|
|
name = "prelude_manifest.txt",
|
|
srcs = [":prelude_files"],
|
|
strip_package_dir = True,
|
|
)
|
|
|
|
# All files for the toolchain install.
|
|
filegroup(
|
|
name = "prelude",
|
|
srcs = [
|
|
":prelude_files",
|
|
":prelude_manifest.txt",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "core_library_files",
|
|
srcs = glob(
|
|
include = ["**/*.carbon"],
|
|
exclude = [
|
|
"prelude.carbon",
|
|
"prelude/**",
|
|
],
|
|
),
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
manifest(
|
|
name = "core_library_manifest.txt",
|
|
srcs = [":core_library_files"],
|
|
strip_package_dir = True,
|
|
)
|
|
|
|
filegroup(
|
|
name = "core_library",
|
|
srcs = [
|
|
":core_library_files",
|
|
":core_library_manifest.txt",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
carbon_library(
|
|
name = "io",
|
|
srcs = ["io.impl.carbon"],
|
|
hdrs = ["io.carbon"],
|
|
visibility = ["//visibility:public"],
|
|
)
|