Skip to content

Commit

Permalink
Fix cxxopts passed to C compiles
Browse files Browse the repository at this point in the history
Previously since the fragment's cxxopts were always passed, these were
included in validating C files
  • Loading branch information
keith authored and erenon committed Oct 6, 2024
1 parent a954245 commit 87a9910
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clang_tidy/clang_tidy.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ def _toolchain_flags(ctx, action_name = ACTION_NAMES.cpp_compile):
ctx = ctx,
cc_toolchain = cc_toolchain,
)
user_compile_flags = ctx.fragments.cpp.copts
if action_name == ACTION_NAMES.cpp_compile:
user_compile_flags.extend(ctx.fragments.cpp.cxxopts)
compile_variables = cc_common.create_compile_variables(
feature_configuration = feature_configuration,
cc_toolchain = cc_toolchain,
user_compile_flags = ctx.fragments.cpp.cxxopts + ctx.fragments.cpp.copts,
user_compile_flags = user_compile_flags,
)
flags = cc_common.get_memory_inefficient_command_line(
feature_configuration = feature_configuration,
Expand Down

0 comments on commit 87a9910

Please sign in to comment.