summaryrefslogtreecommitdiff
path: root/cc/binary.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/binary.go')
-rw-r--r--cc/binary.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/cc/binary.go b/cc/binary.go
index 8428d7ec2..1757f1cd6 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -36,7 +36,7 @@ type BinaryLinkerProperties struct {
Prefix_symbols *string
// if set, install a symlink to the preferred architecture
- Symlink_preferred_arch *bool
+ Symlink_preferred_arch *bool `android:"arch_variant"`
// install symlinks to the binary. Symlink names will have the suffix and the binary
// extension (if any) appended
@@ -106,13 +106,17 @@ func (binary *binaryDecorator) linkerProps() []interface{} {
}
-func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
+func (binary *binaryDecorator) getStemWithoutSuffix(ctx BaseModuleContext) string {
stem := ctx.baseModuleName()
if String(binary.Properties.Stem) != "" {
stem = String(binary.Properties.Stem)
}
- return stem + String(binary.Properties.Suffix)
+ return stem
+}
+
+func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
+ return binary.getStemWithoutSuffix(ctx) + String(binary.Properties.Suffix)
}
func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
@@ -388,7 +392,7 @@ func (binary *binaryDecorator) link(ctx ModuleContext,
objs.coverageFiles = append(objs.coverageFiles, deps.StaticLibObjs.coverageFiles...)
objs.coverageFiles = append(objs.coverageFiles, deps.WholeStaticLibObjs.coverageFiles...)
- binary.coverageOutputFile = TransformCoverageFilesToLib(ctx, objs, builderFlags, binary.getStem(ctx))
+ binary.coverageOutputFile = TransformCoverageFilesToZip(ctx, objs, binary.getStem(ctx))
// Need to determine symlinks early since some targets (ie APEX) need this
// information but will not call 'install'
@@ -398,11 +402,11 @@ func (binary *binaryDecorator) link(ctx ModuleContext,
}
if Bool(binary.Properties.Symlink_preferred_arch) {
- if String(binary.Properties.Stem) == "" && String(binary.Properties.Suffix) == "" {
- ctx.PropertyErrorf("symlink_preferred_arch", "must also specify stem or suffix")
+ if String(binary.Properties.Suffix) == "" {
+ ctx.PropertyErrorf("symlink_preferred_arch", "must also specify suffix")
}
if ctx.TargetPrimary() {
- binary.symlinks = append(binary.symlinks, ctx.baseModuleName())
+ binary.symlinks = append(binary.symlinks, binary.getStemWithoutSuffix(ctx))
}
}