Skip to content

Commit bf135d0

Browse files
cbarretefacebook-github-bot
authored andcommitted
Add support for modifiers to the compilation database BXL script (#936)
Summary: See the commit message for context, and https://github.com/cbarrete/buck2_example/blob/7fd287291f3600e80b94081c8a4f0d2fa355602b/BUCK for an example (run `buck2 bxl prelude//cxx/tools/compilation_database.bxl:generate -m cxx26 -- --targets //...` before and after this change). Pull Request resolved: #936 Reviewed By: alexlian Differential Revision: D74117000 fbshipit-source-id: 69a438252e7779db04777a878fe482329391e7d9
1 parent e5fb704 commit bf135d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prelude/cxx/tools/compilation_database.bxl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def _make_entry(ctx: bxl.Context, compile_command: CxxSrcCompileCommand) -> dict
2727

2828
def _impl(ctx: bxl.Context):
2929
actions = ctx.bxl_actions().actions
30-
targets = flatten(ctx.cli_args.targets)
3130

3231
db = []
33-
for _name, target in ctx.analysis(ctx.configured_targets(targets)).items():
32+
targets = ctx.configured_targets(flatten(ctx.cli_args.targets), modifiers = ctx.modifiers)
33+
for _name, target in ctx.analysis(targets).items():
3434
comp_db_info = target.providers().get(CxxCompilationDbInfo)
3535
if comp_db_info:
3636
db += [_make_entry(ctx, cc) for cc in comp_db_info.info.values()]

0 commit comments

Comments
 (0)