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
This commit is contained in:
Dan Willemsen
2017-09-09 01:15:26 -07:00
parent ace7a6ba43
commit 4f1c3d4116
5 changed files with 72 additions and 1 deletions

View File

@@ -158,6 +158,13 @@ var (
},
"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 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
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 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
},
})
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