aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/cpp/make_cpp.go12
-rw-r--r--make.go11
-rw-r--r--maker/go.go1
3 files changed, 15 insertions, 9 deletions
diff --git a/build/cpp/make_cpp.go b/build/cpp/make_cpp.go
index 824c93b4b..75721ec3d 100644
--- a/build/cpp/make_cpp.go
+++ b/build/cpp/make_cpp.go
@@ -49,7 +49,9 @@ func makeStep(name string, output build.File, source build.FileSet, always bool,
if always {
s.AlwaysRun()
}
- maker.List(name).DependsOn(e)
+ if name != "" {
+ maker.List("cc:" + name).DependsOn(e)
+ }
maker.List("cc").DependsOn(e)
return s
}
@@ -82,7 +84,7 @@ func MakeCompile(sources build.FileSet, cfg Config, env build.Environment) build
// skip any objects which have existing build steps
continue
}
- s := makeStep(cfg.Name, object, build.Files(source), env.ForceBuild,
+ s := makeStep("", object, build.Files(source), env.ForceBuild,
func(*maker.Step) error {
env.Logger = env.Logger.Enter(object.Name())
env.Logger.Enter("C++.Compile")
@@ -118,7 +120,7 @@ func MakeStaticLibrary(inputs build.FileSet, cfg Config, env build.Environment)
output = output.ChangeExt(*cfg.OutputExt)
}
- makeStep(cfg.Name, output, objects, env.ForceBuild,
+ makeStep("", output, objects, env.ForceBuild,
func(*maker.Step) error {
env.Logger = logger(env, cfg.Name).Enter("C++.StaticLibrary")
return cfg.Toolchain.Archiver(objects, output, cfg, env)
@@ -196,9 +198,9 @@ func MakeExecutable(inputs build.FileSet, cfg Config, env build.Environment) bui
func MakeRunTest(test build.File, cfg Config) {
// We only run tests on the host OS.
if cfg.OS == maker.HostOS {
- phony := maker.Virtual("")
+ phony := maker.Virtual("cc:" + test.Name() + ":run")
maker.Command(makeEntity(test)).Creates(phony)
- maker.List("test").DependsOn(phony)
+ maker.List("cc_test").DependsOn(phony)
}
}
diff --git a/make.go b/make.go
index 9cab09360..da67231b9 100644
--- a/make.go
+++ b/make.go
@@ -111,7 +111,7 @@ func init() {
//
List("code").DependsOn("embed", "rpcapi", "apic", "codergen")
// The native code rules
- Apps.Gapir = Virtual("gapir")
+ Apps.Gapir = Virtual("cc:replayd")
cctargets := []string{*targetOS}
if os.Getenv("ANDROID_NDK_ROOT") != "" {
cctargets = append(cctargets, []string{"android-arm", "android-arm64"}...)
@@ -119,8 +119,11 @@ func init() {
cc.Graph(cctargets)
// The testing rules
gotest := GoTest(GPURoot + "/...")
- Creator(gotest).DependsOn("code", Apps.Gapir)
- List("test").DependsOn(gotest)
+ // Runtime dependencies
+ Creator(Tools.Gapit).DependsOn("cc:spy")
+ List("runtime").DependsOn(Apps.Gapir, "cc:spy")
+ Creator(gotest).DependsOn("code", "runtime")
+ List("test").DependsOn("go_test", "cc_test")
// The main binary rules
Apps.Gapis = GoInstall(GPURoot + "/server/gapis")
Creator(Apps.Gapis).DependsOn("code")
@@ -129,7 +132,7 @@ func init() {
List("apps").DependsStruct(Apps)
// Application launchers
Command(Apps.Gapis).Creates(Virtual("gapis")).DependsOn(Apps.Gapir)
- Command(Apps.Gapid, "--gxuidebug").Creates(Virtual("gapid")).DependsOn(Apps.Gapis, Apps.Gapir)
+ Command(Apps.Gapid, "--gxuidebug").Creates(Virtual("gapid")).DependsOn(Apps.Gapis, "runtime")
// Utilties
GoRun(Path(gpusrc, "tools/clean_generated/main.go"), gpusrc).Creates(Virtual("clean_gpu"))
GoRun(Path(gpusrc, "tools/copyright/copyright/main.go"), "-o", gpusrc).Creates(Virtual("copyright")).DependsOn(embedCopyright)
diff --git a/maker/go.go b/maker/go.go
index 54c8dbf35..90053db74 100644
--- a/maker/go.go
+++ b/maker/go.go
@@ -39,6 +39,7 @@ func GoInstall(module string) Entity {
func GoTest(module string) Entity {
test := Virtual("")
GoCommand("test", module).Creates(test)
+ List("go_test").DependsOn(test)
return test
}