Skip to content

Commit

Permalink
Update unix_cc_toolchain_config.bzl
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum authored Jul 11, 2024
1 parent f374372 commit a96abe6
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions tools/cpp/unix_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,33 @@ def parse_headers_support(parse_headers_tool_path):
if not parse_headers_tool_path:
return [], []
action_configs = [
action_config(
action_name = ACTION_NAMES.c_header_parsing,
tools = [
tool(path = parse_headers_tool_path),
],
flag_sets = [
flag_set(
flag_groups = [
flag_group(
flags = [
"-xc-header",
"-fsyntax-only",
],
),
],
),
],
implies = [
# Copied from the legacy feature definition in CppActionConfigs.java.
"legacy_compile_flags",
"user_compile_flags",
"sysroot",
"unfiltered_compile_flags",
"compiler_input_flags",
"compiler_output_flags",
],
),
action_config(
action_name = ACTION_NAMES.cpp_header_parsing,
tools = [
Expand All @@ -112,10 +139,6 @@ def parse_headers_support(parse_headers_tool_path):
flag_groups = [
flag_group(
flags = [
# Note: This treats all headers as C++ headers, which may lead to
# parsing failures for C headers that are not valid C++.
# For such headers, use features = ["-parse_headers"] to selectively
# disable parsing.
"-xc++-header",
"-fsyntax-only",
],
Expand Down Expand Up @@ -145,6 +168,7 @@ all_compile_actions = [
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.c_header_parsing,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
Expand Down

0 comments on commit a96abe6

Please sign in to comment.