Bazel optional data attribute file

Refresh

6 days ago

Views

5 time

0

I would like to have a file optionally provided to the data attribute and have my program to deal with the file being present or not.

If the file doesn't exist, bazel reports missing input file...

cc_binary(
    name = "test",
    srcs = ["main.c"],
    data = [":conf.yml"]
)

Is there any way to make it optional ?

0 answers