Allow custom ar flags to be set.

am: 83d9f71cc5

Change-Id: I3768b87f329f79f186f0cb6a67871fc6f9ab838a
This commit is contained in:
Vishwath Mohan 2017-03-16 23:09:31 +00:00 committed by android-build-merger
commit cabe0dc741
3 changed files with 6 additions and 0 deletions

View File

@ -184,6 +184,7 @@ func init() {
type builderFlags struct {
globalFlags string
arFlags string
asFlags string
cFlags string
conlyFlags string
@ -367,6 +368,9 @@ func TransformObjToStaticLib(ctx android.ModuleContext, objFiles android.Paths,
arCmd := gccCmd(flags.toolchain, "ar")
arFlags := "crsPD"
if flags.arFlags != "" {
arFlags += " " + flags.arFlags
}
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: ar,

View File

@ -96,6 +96,7 @@ type PathDeps struct {
type Flags struct {
GlobalFlags []string // Flags that apply to C, C++, and assembly source files
ArFlags []string // Flags that apply to ar
AsFlags []string // Flags that apply to assembly source files
CFlags []string // Flags that apply to C and C++ source files
ConlyFlags []string // Flags that apply to C source files

View File

@ -88,6 +88,7 @@ func moduleToLibName(module string) (string, error) {
func flagsToBuilderFlags(in Flags) builderFlags {
return builderFlags{
globalFlags: strings.Join(in.GlobalFlags, " "),
arFlags: strings.Join(in.ArFlags, " "),
asFlags: strings.Join(in.AsFlags, " "),
cFlags: strings.Join(in.CFlags, " "),
conlyFlags: strings.Join(in.ConlyFlags, " "),