aboutsummaryrefslogtreecommitdiffstats
path: root/cc/gen.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-10-20 16:11:43 -0700
committerColin Cross <ccross@android.com>2016-10-27 15:28:09 -0700
commit0c461f1f6e2a1663b426eec2247e5a26f2822970 (patch)
tree394e04c7672fc47f46e40d9447717aa381b3b541 /cc/gen.go
parent4f6fc9c1d81687914cc77bf06b10af8022f64198 (diff)
downloadbuild_soong-0c461f1f6e2a1663b426eec2247e5a26f2822970.tar.gz
build_soong-0c461f1f6e2a1663b426eec2247e5a26f2822970.tar.bz2
build_soong-0c461f1f6e2a1663b426eec2247e5a26f2822970.zip
Add support for .proto files
.proto files are translated to .pb.cc and .pb.h files, which are then compiled normally. Bug: 32286026 Test: mmma -j system/extras/perfprofd Change-Id: I538071424d667aacf35b4b8bfebe217f5f092726
Diffstat (limited to 'cc/gen.go')
-rw-r--r--cc/gen.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cc/gen.go b/cc/gen.go
index b35eee5d..14518956 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -95,6 +95,10 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths,
cppFile := android.GenPathWithExt(ctx, srcFile, "cpp")
srcFiles[i] = cppFile
genLex(ctx, srcFile, cppFile)
+ case ".proto":
+ cppFile, headerFile := genProto(ctx, srcFile, buildFlags.protoFlags)
+ srcFiles[i] = cppFile
+ deps = append(deps, headerFile)
}
}