Why does a header library need another module to be compiled first? It's not actually compiling anything. I'm assuming you actually want to export the dependencies that generated some header files? Depending on the full compilation of a dependency will cause your builds to be more linear (and thus slower).
If you're generating headers, adding them to LOCAL_GENERATED_SOURCES will add the appropriate dependencies. They need to be in the proper location in order for the include directories to be handled anyways.
There is LOCAL_EXPORT_C_INCLUDE_DEPS, but unless you're doing something really weird, you shouldn't need to do that. If you're just re-exporting another module's generated header files, that module should be setting up the exported dependencies, and we'll automatically pass those along.
In Soong, this is a bit more standardized, as you're rarely writing the explicit rules. Anything that looks like a genrule (implements
SourceFileGenerator) can be used in generated_headers / export_generated_headers:
cc_library_headers {
name: "my_header_library",
...
generated_headers: ["my_genrule_type_module"],
export_generated_headers: ["my_genrule_type_module"],
}
- Dan