I have a cmdline tool which can accept multiple inputs with different cmd options.
mytool --include=some_include1 --include=some_include2 --inlcude=... source1 source2 ...
So I have to write a genrule
with
filegroup(
name = "include_group",
srcs = ["some_include1", "some_include2"],
)
filegroup(
name = "source_group",
srcs = ["source1", "source2"],
)
genrule(
name = "myrule",
srcs = [":include_group"] + [":source_group"],
outs = ["out.cpp"],
tools = ["mytool"],
cmd = "$(location :mytool) --include=$(locations :path_group) $(locations :source_group)"
)
The cmd line tunout to be:
mytool --include=some_include1 some_include2 source1 source2
Notice that the option label of some_include2
is missing.
So my question is: how to add the option label to each label in :include_group
.