I am trying to implement automatic dependency population based on c includes using gazelle. The problem with that is that some source is generated using a custom rule "bazel build gen_src" and these src files are then referenced by cc_library copts to bazel-<project>/external/.. . Since this reference is not available anymore after running "bazel build gazelle" I cant resolve my src dependencies properly. A simple overview of my project structure:
another.h <- this is generated by the generate target
my_rules:
gen_rule_module: <- module to handle the src file generation
gazelle_module: <- module to handle custom gazelle setup
app:
some_src:
some.c <- might depend on some.h and also on another.h
some.h
gen_src:
BUILDFILE <- generate target is declared here
I know that having a persistant location for the generated src files would solve this problem, but I was wondering if this dependency across targets can also be tackled somehow else? If I am fully on the wrong path here I would also appreciate input for optimization. Thanks in advance.