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
diff --git a/cc/builder.go b/cc/builder.go
index 1a4f505..b5bdc3d 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -158,6 +158,13 @@
 		},
 		"asFlags")
 
+	windres = pctx.AndroidStaticRule("windres",
+		blueprint.RuleParams{
+			Command:     "$windresCmd $flags -I$$(dirname $in) -i $in -o $out",
+			CommandDeps: []string{"$windresCmd"},
+		},
+		"windresCmd", "flags")
+
 	_ = pctx.SourcePathVariable("sAbiDumper", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/header-abi-dumper")
 
 	// -w has been added since header-abi-dumper does not need to produce any sort of diagnostic information.
@@ -332,7 +339,8 @@
 
 		objFiles[i] = objFile
 
-		if srcFile.Ext() == ".asm" {
+		switch srcFile.Ext() {
+		case ".asm":
 			ctx.ModuleBuild(pctx, android.ModuleBuildParams{
 				Rule:        yasm,
 				Description: "yasm " + srcFile.Rel(),
@@ -344,6 +352,19 @@
 				},
 			})
 			continue
+		case ".rc":
+			ctx.ModuleBuild(pctx, android.ModuleBuildParams{
+				Rule:        windres,
+				Description: "windres " + srcFile.Rel(),
+				Output:      objFile,
+				Input:       srcFile,
+				OrderOnly:   deps,
+				Args: map[string]string{
+					"windresCmd": gccCmd(flags.toolchain, "windres"),
+					"flags":      flags.toolchain.WindresFlags(),
+				},
+			})
+			continue
 		}
 
 		var moduleCflags string