Merge "Assemble API surface headers before compiling rdeps"
This commit is contained in:
@@ -106,7 +106,6 @@ func (d *apiLibraryDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps
|
||||
d.libraryDecorator.reexportFlags(deps.ReexportedFlags...)
|
||||
d.libraryDecorator.reexportDeps(deps.ReexportedDeps...)
|
||||
d.libraryDecorator.addExportedGeneratedHeaders(deps.ReexportedGeneratedHeaders...)
|
||||
d.libraryDecorator.flagExporter.setProvider(ctx)
|
||||
|
||||
if d.properties.Src == nil {
|
||||
ctx.PropertyErrorf("src", "src is a required property")
|
||||
@@ -116,6 +115,12 @@ func (d *apiLibraryDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps
|
||||
// Build orchestrator will be responsible for creating a connected ninja graph.
|
||||
in := android.MaybeExistentPathForSource(ctx, ctx.ModuleDir(), *d.properties.Src)
|
||||
|
||||
// Make the _compilation_ of rdeps have an order-only dep on cc_api_library.src (an .so file)
|
||||
// The .so file itself has an order-only dependency on the headers contributed by this library.
|
||||
// Creating this dependency ensures that the headers are assembled before compilation of rdeps begins.
|
||||
d.libraryDecorator.reexportDeps(in)
|
||||
d.libraryDecorator.flagExporter.setProvider(ctx)
|
||||
|
||||
d.unstrippedOutputFile = in
|
||||
libName := d.libraryDecorator.getLibName(ctx) + flags.Toolchain.ShlibSuffix()
|
||||
|
||||
|
@@ -278,4 +278,9 @@ func TestExportDirFromStubLibrary(t *testing.T) {
|
||||
android.AssertStringDoesNotContain(t, "Vendor binary should not compile using headers of source", vendorCFlags, "-Isource_include_dir")
|
||||
android.AssertStringDoesContain(t, "Vendor binary should compile using system headers provided by stub", vendorCFlags, "-isystem stub_system_include_dir")
|
||||
android.AssertStringDoesNotContain(t, "Vendor binary should not compile using system headers of source", vendorCFlags, "-isystem source_system_include_dir")
|
||||
|
||||
vendorImplicits := ctx.ModuleForTests("vendorbin", "android_vendor.29_arm64_armv8-a").Rule("cc").OrderOnly.Strings()
|
||||
// Building the stub.so file first assembles its .h files in multi-tree out.
|
||||
// These header files are required for compiling the other API domain (vendor in this case)
|
||||
android.AssertStringListContains(t, "Vendor binary compilation should have an implicit dep on the stub .so file", vendorImplicits, "libfoo.so")
|
||||
}
|
||||
|
Reference in New Issue
Block a user