Merge "Have `symlink_preferred_arch: true` honor the `stem` property." am: d7607c1c99
am: 299abf19c3
Change-Id: If982b553818062f476298027f0ae19b9e6699a06
This commit is contained in:
commit
bcb2d44966
14
cc/binary.go
14
cc/binary.go
|
@ -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 {
|
||||
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue