Move fuzz phony to be make-defined, and add to dist.
Add the fuzz packages to dist. This requires that the phony for 'make' be define in make itself, rather than in Soong. See comments on other patch in topic for more information. Bug: 141026328 Test: m fuzz dist Change-Id: I4cd476adcfa42e4b40911c4a32427a7b00c67cc3
This commit is contained in:
parent
84dfc3d331
commit
a0a5e19140
1 changed files with 11 additions and 12 deletions
23
cc/fuzz.go
23
cc/fuzz.go
|
@ -16,8 +16,8 @@ package cc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
|
||||||
"github.com/google/blueprint/proptools"
|
"github.com/google/blueprint/proptools"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
|
@ -161,6 +161,7 @@ func NewFuzz(hod android.HostOrDeviceSupported) *Module {
|
||||||
// Responsible for generating GNU Make rules that package fuzz targets into
|
// Responsible for generating GNU Make rules that package fuzz targets into
|
||||||
// their architecture & target/host specific zip file.
|
// their architecture & target/host specific zip file.
|
||||||
type fuzzPackager struct {
|
type fuzzPackager struct {
|
||||||
|
packages android.Paths
|
||||||
}
|
}
|
||||||
|
|
||||||
func fuzzPackagingFactory() android.Singleton {
|
func fuzzPackagingFactory() android.Singleton {
|
||||||
|
@ -220,15 +221,12 @@ func (s *fuzzPackager) GenerateBuildActions(ctx android.SingletonContext) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// List of architecture + host/device specific packages to build via. 'make fuzz'.
|
|
||||||
var archDirTargets android.Paths
|
|
||||||
|
|
||||||
for archDir, filesToZip := range archDirs {
|
for archDir, filesToZip := range archDirs {
|
||||||
arch := archDir.Base()
|
arch := archDir.Base()
|
||||||
hostOrTarget := filepath.Base(filepath.Dir(archDir.String()))
|
hostOrTarget := filepath.Base(filepath.Dir(archDir.String()))
|
||||||
builder := android.NewRuleBuilder()
|
builder := android.NewRuleBuilder()
|
||||||
outputFile := android.PathForOutput(ctx, "fuzz-"+hostOrTarget+"-"+arch+".zip")
|
outputFile := android.PathForOutput(ctx, "fuzz-"+hostOrTarget+"-"+arch+".zip")
|
||||||
archDirTargets = append(archDirTargets, outputFile)
|
s.packages = append(s.packages, outputFile)
|
||||||
|
|
||||||
command := builder.Command().BuiltTool(ctx, "soong_zip").
|
command := builder.Command().BuiltTool(ctx, "soong_zip").
|
||||||
Flag("-j").
|
Flag("-j").
|
||||||
|
@ -242,11 +240,12 @@ func (s *fuzzPackager) GenerateBuildActions(ctx android.SingletonContext) {
|
||||||
builder.Build(pctx, ctx, "create-fuzz-package-"+arch+"-"+hostOrTarget,
|
builder.Build(pctx, ctx, "create-fuzz-package-"+arch+"-"+hostOrTarget,
|
||||||
"Create fuzz target packages for "+arch+"-"+hostOrTarget)
|
"Create fuzz target packages for "+arch+"-"+hostOrTarget)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ctx.Build(pctx, android.BuildParams{
|
|
||||||
Rule: blueprint.Phony,
|
func (s *fuzzPackager) MakeVars(ctx android.MakeVarsContext) {
|
||||||
Output: android.PathForPhony(ctx, "fuzz"),
|
// TODO(mitchp): Migrate this to use MakeVarsContext::DistForGoal() when it's
|
||||||
Implicits: archDirTargets,
|
// ready to handle phony targets created in Soong. In the meantime, this
|
||||||
Description: "Build all Android fuzz targets, and create packages.",
|
// exports the phony 'fuzz' target and dependencies on packages to
|
||||||
})
|
// core/main.mk so that we can use dist-for-goals.
|
||||||
|
ctx.Strict("SOONG_FUZZ_PACKAGING_ARCH_MODULES", strings.Join(s.packages.Strings(), " "))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue