Skip to content

Commit ae1df74

Browse files
keithcopybara-github
authored andcommitted
Fix empty flags errors
Copybara Import from #575 BEGIN_PUBLIC Fix empty flags errors (#575) If the user passed empty flags this failed Fixes #404 Closes #575 END_PUBLIC COPYBARA_INTEGRATE_REVIEW=#575 from keith:ks/fix-empty-flags-errors a62a83a PiperOrigin-RevId: 871426931 Change-Id: Id3cd57fc8ce1a91b9cb3248594708cf9c6875744
1 parent a464a75 commit ae1df74

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cc/private/toolchain/windows_cc_toolchain_config.bzl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,11 @@ def _impl(ctx):
631631
iterate_over = "user_archiver_flags",
632632
expand_if_available = "user_archiver_flags",
633633
),
634+
] + ([
634635
flag_group(
635636
flags = ctx.attr.archiver_flags,
636637
),
637-
],
638+
] if ctx.attr.archiver_flags else []),
638639
),
639640
],
640641
)
@@ -645,7 +646,9 @@ def _impl(ctx):
645646
flag_sets = [
646647
flag_set(
647648
actions = all_link_actions,
648-
flag_groups = [flag_group(flags = ctx.attr.default_link_flags)],
649+
flag_groups = [
650+
flag_group(flags = ctx.attr.default_link_flags),
651+
] if ctx.attr.default_link_flags else [],
649652
),
650653
],
651654
)

0 commit comments

Comments
 (0)