From 01739302cbf3c26e28bd8dcecc7dc90ae0bbdfc0 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 18 Nov 2015 15:15:41 -0800 Subject: [PATCH] Allow multiple calls to ctx.SetBuildDir ctx.SetBuildDir is called by the bootstrap singleton, which is always last. In order to allow the primary builder to set the directory for .ninja_log/.ninja_deps, remove the panic on multiple calls to ctx.SetBuildDir, and always used the value passed by the first caller. --- context.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/context.go b/context.go index a20de91..c1d5b38 100644 --- a/context.go +++ b/context.go @@ -1913,10 +1913,9 @@ func (c *Context) requireNinjaVersion(major, minor, micro int) { } func (c *Context) setBuildDir(value *ninjaString) { - if c.buildDir != nil { - panic("buildDir set multiple times") + if c.buildDir == nil { + c.buildDir = value } - c.buildDir = value } func (c *Context) makeUniquePackageNames( -- GitLab