aboutsummaryrefslogtreecommitdiffstats
path: root/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'context.go')
-rw-r--r--context.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/context.go b/context.go
index 919377c..69f26f6 100644
--- a/context.go
+++ b/context.go
@@ -102,6 +102,8 @@ type Context struct {
requiredNinjaMinor int // For the ninja_required_version variable
requiredNinjaMicro int // For the ninja_required_version variable
+ subninjas []string
+
// set lazily by sortedModuleGroups
cachedSortedModuleGroups []*moduleGroup
@@ -2939,6 +2941,11 @@ func (c *Context) WriteBuildFile(w io.Writer) error {
return err
}
+ err = c.writeSubninjas(nw)
+ if err != nil {
+ return err
+ }
+
// TODO: Group the globals by package.
err = c.writeGlobalVariables(nw)
@@ -3048,6 +3055,13 @@ func (c *Context) writeNinjaRequiredVersion(nw *ninjaWriter) error {
return nw.BlankLine()
}
+func (c *Context) writeSubninjas(nw *ninjaWriter) error {
+ for _, subninja := range c.subninjas {
+ nw.Subninja(subninja)
+ }
+ return nw.BlankLine()
+}
+
func (c *Context) writeBuildDir(nw *ninjaWriter) error {
if c.ninjaBuildDir != nil {
err := nw.Assign("builddir", c.ninjaBuildDir.Value(c.pkgNames))