aboutsummaryrefslogtreecommitdiffstats
path: root/cc/builder.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-09-26 17:33:01 -0700
committerDan Willemsen <dwillemsen@google.com>2016-10-31 16:18:49 -0700
commit5cb580f407d2b1b639d7aeea8e1310740e55fe1c (patch)
tree06df2217c80ade92c65e85f87f8d9e959ba96257 /cc/builder.go
parent5d5db02bf6cd527455abcbf3502e990bb2d21e5a (diff)
downloadbuild_soong-5cb580f407d2b1b639d7aeea8e1310740e55fe1c.tar.gz
build_soong-5cb580f407d2b1b639d7aeea8e1310740e55fe1c.tar.bz2
build_soong-5cb580f407d2b1b639d7aeea8e1310740e55fe1c.zip
Start using "struct Objects" to store object Paths
So that we can represent other files that get generated along with the objects, like the gcno coverage information, and per-file clang-tidy runs. Test: Soong's build.ninja identical before/after Change-Id: I5c553a153c436d5403549f62c73fe79c5f101779
Diffstat (limited to 'cc/builder.go')
-rw-r--r--cc/builder.go24
1 files changed, 21 insertions, 3 deletions
diff --git a/cc/builder.go b/cc/builder.go
index 60aad0b4..0006ed36 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -182,11 +182,27 @@ type builderFlags struct {
stripAddGnuDebuglink bool
}
+type Objects struct {
+ objFiles android.Paths
+}
+
+func (a Objects) Copy() Objects {
+ return Objects{
+ objFiles: append(android.Paths{}, a.objFiles...),
+ }
+}
+
+func (a Objects) Append(b Objects) Objects {
+ return Objects{
+ objFiles: append(a.objFiles, b.objFiles...),
+ }
+}
+
// Generate rules for compiling multiple .c, .cpp, or .S files to individual .o files
func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles android.Paths,
- flags builderFlags, deps android.Paths) (objFiles android.Paths) {
+ flags builderFlags, deps android.Paths) Objects {
- objFiles = make(android.Paths, len(srcFiles))
+ objFiles := make(android.Paths, len(srcFiles))
cflags := flags.globalFlags + " " + flags.cFlags + " " + flags.conlyFlags
cppflags := flags.globalFlags + " " + flags.cFlags + " " + flags.cppFlags
@@ -250,7 +266,9 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
})
}
- return objFiles
+ return Objects{
+ objFiles: objFiles,
+ }
}
// Generate a rule for compiling multiple .o files to a static library (.a)