Compile soong_build for debugging if needed.

That is, when SOONG_DELVE= is set.

Test: "m nothing; SOONG_DELVE=port m nothing; m nothing"
Change-Id: I16bd4e54e81b93202573935df134d413feea9bb2
diff --git a/ui/build/soong.go b/ui/build/soong.go
index fee5723..9afcb88 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -65,9 +65,10 @@
 // A tiny struct used to tell Blueprint that it's in bootstrap mode. It would
 // probably be nicer to use a flag in bootstrap.Args instead.
 type BlueprintConfig struct {
-	srcDir        string
-	buildDir      string
-	ninjaBuildDir string
+	srcDir           string
+	buildDir         string
+	ninjaBuildDir    string
+	debugCompilation bool
 }
 
 func (c BlueprintConfig) SrcDir() string {
@@ -82,6 +83,10 @@
 	return c.ninjaBuildDir
 }
 
+func (c BlueprintConfig) DebugCompilation() bool {
+	return c.debugCompilation
+}
+
 func bootstrapBlueprint(ctx Context, config Config) {
 	ctx.BeginTrace(metrics.RunSoong, "blueprint bootstrap")
 	defer ctx.EndTrace()
@@ -102,9 +107,10 @@
 	blueprintCtx := blueprint.NewContext()
 	blueprintCtx.SetIgnoreUnknownModuleTypes(true)
 	blueprintConfig := BlueprintConfig{
-		srcDir:        os.Getenv("TOP"),
-		buildDir:      config.SoongOutDir(),
-		ninjaBuildDir: config.OutDir(),
+		srcDir:           os.Getenv("TOP"),
+		buildDir:         config.SoongOutDir(),
+		ninjaBuildDir:    config.OutDir(),
+		debugCompilation: os.Getenv("SOONG_DELVE") != "",
 	}
 
 	bootstrap.RunBlueprint(args, blueprintCtx, blueprintConfig)