Adding dependencies for Header Libraries

152 views
Skip to first unread message

Vinayak Soni

unread,
Oct 16, 2019, 12:58:25 PM10/16/19
to Android Building
Hi,

Suppose my header library depends on another module to be compiled first. For other modules, you can add LOCAL_ADDITIONAL_DEPENDENCIES but that does not work for HEADER_LIBRARIES. Is there a way this can be done?

TIA,
Vinayak

Dan Willemsen

unread,
Oct 17, 2019, 1:09:29 PM10/17/19
to Android Building
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

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/8735b4b2-0a0c-4a0c-a422-88d2b5037330%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages