Fix static+shared with generated sources

Clear out the generated sources when reusing object files from the
static library for the shared library to avoid linking them twice.

Change-Id: Idc145f817acc93df4c3b266ac7647299399bc8eb
This commit is contained in:
Colin Cross 2016-07-27 10:30:21 -07:00
parent e7b07137d4
commit 5dab840e24

View file

@ -2691,6 +2691,7 @@ func linkageMutator(mctx android.BottomUpMutatorContext) {
// Optimize out compiling common .o files twice for static+shared libraries
mctx.AddInterVariantDependency(reuseObjTag, shared, static)
sharedCompiler.baseCompiler.Properties.Srcs = nil
sharedCompiler.baseCompiler.Properties.Generated_sources = nil
}
}
} else if linker.buildStatic() {