Files
carbon-lang/bazel/cc_toolchains/cc_toolchain_actions.bzl
T
Chandler Carruth a1a9c02cdc Refactor Bazel toolchain to use rules_cc action groups (#7086)
Rather than defining our own action groups, work to re-use the
`rules_cc` ones, as they are (much) more comprehensive. Also, completely
eliminate the `codegen` action group as it was not well used. For
example, `-march` flags and `-O` flags change the preprocessor macros
defined. There isn't a really great "codegen" heuristic, so just pass
those flags to all compiles which is simpler anyways.

I'm tempted to do the same with preprocessor actions, but maybe it makes
sense to have that one stay separate.

Assisted-by: Antigravity with Gemini
2026-04-21 16:40:24 +00:00

22 lines
805 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
"""Useful sets of actions for defining `cc_toolchain_config` features."""
load("@rules_cc//cc:action_names.bzl", "ACTION_NAMES", "ACTION_NAME_GROUPS")
# all_c_compile_actions includes actions that compile C or assembly.
all_c_compile_actions = [
x
for x in ACTION_NAME_GROUPS.all_cc_compile_actions
if x not in ACTION_NAME_GROUPS.all_cpp_compile_actions
]
# preprocessor_compile_actions includes actions that run the preprocessor.
preprocessor_compile_actions = [
x
for x in ACTION_NAME_GROUPS.all_cc_compile_actions
if x not in [ACTION_NAMES.assemble, ACTION_NAMES.cpp_module_codegen]
]