mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 12:41:06 +01:00
This let's you point Bazel at an installed toolchain or download one of our release archives. When you do, it will configure itself as a C++ Bazel toolchain. This toolchain works reasonably well, but doesn't cache the C++ runtimes, and so linking is inefficient. The next step will be to pivot the runtimes from the implicitly on-demand (which can't cache when using a sandboxed build system like Bazel) to _explicit_ on-demand runtimes directly with Bazel support. I've included an example Bazel project that uses this and provides a bunch of documentation and an example script that should let folks try this out easily. --------- Co-authored-by: Geoff Romer <gromer@google.com> Co-authored-by: David Blaikie <dblaikie@gmail.com>
66 lines
1.6 KiB
Python
66 lines
1.6 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_skylib//lib:selects.bzl", "selects")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
# For use by defs.bzl.
|
|
# Matches when asan is enabled on a macOS platform.
|
|
selects.config_setting_group(
|
|
name = "macos_asan",
|
|
match_all = [
|
|
":is_macos",
|
|
":macos_asan_build_modes",
|
|
],
|
|
)
|
|
|
|
# For use by defs.bzl.
|
|
# Matches macOS platforms.
|
|
config_setting(
|
|
name = "is_macos",
|
|
constraint_values = ["@platforms//os:macos"],
|
|
)
|
|
|
|
# For use by defs.bzl.
|
|
# Matches build modes where asan is enabled.
|
|
selects.config_setting_group(
|
|
name = "macos_asan_build_modes",
|
|
match_any = [
|
|
":dbg",
|
|
":fastbuild",
|
|
],
|
|
)
|
|
|
|
# For use by defs.bzl.
|
|
# Matches dbg.
|
|
config_setting(
|
|
name = "dbg",
|
|
values = {"compilation_mode": "dbg"},
|
|
)
|
|
|
|
# For use by defs.bzl.
|
|
# Matches fastbuild.
|
|
config_setting(
|
|
name = "fastbuild",
|
|
values = {"compilation_mode": "fastbuild"},
|
|
)
|
|
|
|
filegroup(
|
|
name = "installed_cc_toolchain_starlark",
|
|
srcs = [
|
|
"cc_toolchain_actions.bzl",
|
|
"cc_toolchain_base_features.bzl",
|
|
"cc_toolchain_config_features.bzl",
|
|
"cc_toolchain_cpp_features.bzl",
|
|
"cc_toolchain_debugging.bzl",
|
|
"cc_toolchain_features.bzl",
|
|
"cc_toolchain_linking.bzl",
|
|
"cc_toolchain_modules.bzl",
|
|
"cc_toolchain_optimization.bzl",
|
|
"cc_toolchain_sanitizer_features.bzl",
|
|
"cc_toolchain_tools.bzl",
|
|
],
|
|
)
|