mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +01:00
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
22 lines
805 B
Python
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]
|
|
]
|