Add support for Optional parameter to build definitions
Build definitions can now specify Optional. If Optional is not specified the build definition will be followed by a default definition for all outputs. Change-Id: Iada83b2ef32bfb599b3cc580263f12bc002e1cdb
This commit is contained in:
parent
701fbad02b
commit
aa847f2893
1 changed files with 5 additions and 0 deletions
|
@ -227,6 +227,7 @@ type buildDef struct {
|
|||
Implicits []*ninjaString
|
||||
OrderOnly []*ninjaString
|
||||
Args map[Variable]*ninjaString
|
||||
Optional bool
|
||||
}
|
||||
|
||||
func parseBuildParams(scope scope, params *BuildParams) (*buildDef,
|
||||
|
@ -327,6 +328,10 @@ func (b *buildDef) WriteTo(nw *ninjaWriter, pkgNames map[*PackageContext]string)
|
|||
}
|
||||
}
|
||||
|
||||
if !b.Optional {
|
||||
nw.Default(outputs...)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue