aboutsummaryrefslogtreecommitdiffstats
path: root/cc/gen.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2017-09-09 01:15:26 -0700
committerDan Willemsen <dwillemsen@google.com>2017-09-09 13:06:25 -0700
commit4f1c3d41161ce9f8069aec8d491d233d865914e0 (patch)
tree936ed57e83f4762017b24e0359bde645c43b98b4 /cc/gen.go
parentace7a6ba43fea035e3189085184da4c2e6fb287c (diff)
downloadbuild_soong-4f1c3d41161ce9f8069aec8d491d233d865914e0.tar.gz
build_soong-4f1c3d41161ce9f8069aec8d491d233d865914e0.tar.bz2
build_soong-4f1c3d41161ce9f8069aec8d491d233d865914e0.zip
Add support for Windows Message Compiler
We've only got one user of this currently, but since it needs the location of the toolchain, and different flags based on 32 vs 64-bit, it's easier just to add support than to get this into a genrule. Test: Convert external/mdnsresponder to Soong, build Change-Id: I6c19a82bc14f6ab556f6cc5f37164862ba5f9083
Diffstat (limited to 'cc/gen.go')
-rw-r--r--cc/gen.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/cc/gen.go b/cc/gen.go
index 7a22abdd..6c9579ed 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -54,6 +54,13 @@ var (
Deps: blueprint.DepsGCC,
},
"aidlFlags", "outDir")
+
+ windmc = pctx.AndroidStaticRule("windmc",
+ blueprint.RuleParams{
+ Command: "$windmcCmd -r$$(dirname $out) -h$$(dirname $out) $in",
+ CommandDeps: []string{"$windmcCmd"},
+ },
+ "windmcCmd")
)
func genYacc(ctx android.ModuleContext, yaccFile android.Path, outFile android.ModuleGenPath, yaccFlags string) (headerFile android.ModuleGenPath) {
@@ -100,6 +107,26 @@ func genLex(ctx android.ModuleContext, lexFile android.Path, outFile android.Mod
})
}
+func genWinMsg(ctx android.ModuleContext, srcFile android.Path, flags builderFlags) (android.Path, android.Path) {
+ headerFile := android.GenPathWithExt(ctx, "windmc", srcFile, "h")
+ rcFile := android.GenPathWithExt(ctx, "windmc", srcFile, "rc")
+
+ windmcCmd := gccCmd(flags.toolchain, "windmc")
+
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
+ Rule: windmc,
+ Description: "windmc " + srcFile.Rel(),
+ Output: rcFile,
+ ImplicitOutput: headerFile,
+ Input: srcFile,
+ Args: map[string]string{
+ "windmcCmd": windmcCmd,
+ },
+ })
+
+ return rcFile, headerFile
+}
+
func genSources(ctx android.ModuleContext, srcFiles android.Paths,
buildFlags builderFlags) (android.Paths, android.Paths) {
@@ -137,6 +164,10 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths,
cppFile := rsGeneratedCppFile(ctx, srcFile)
rsFiles = append(rsFiles, srcFiles[i])
srcFiles[i] = cppFile
+ case ".mc":
+ rcFile, headerFile := genWinMsg(ctx, srcFile, buildFlags)
+ srcFiles[i] = rcFile
+ deps = append(deps, headerFile)
}
}