$ python gencpp.py
This command creates the cpp file foo.cpp in the working directory.
I want to run this command in bazel before creation to include foo.cpp in the cc_binary srcs attribute.
What I tried:
genrule( name = 'foo', outs = ['foo.cpp'], cmd = 'python gencpp.py', ) cc_library( srcs = ['foo.cpp'],
the declared output of 'external / somelib / foo.cpp' was not created by genrule. This is probably due to the fact that genrule did not actually generate this output, or because the output was a directory, and genrule was started remotely (note that only the contents of the declared files unloaded from genrules are started remotely).
I know that there is a solution that requires gencpp.py be slightly modified, but that is not what I am looking for.
source share