Add ctx.Windows()

Replace ctx.Os() == android.Windows with ctx.Windows()

Test: builds
Change-Id: I7c24c39bcf54a51ad152b21c0021e40a0c07f189
This commit is contained in:
Colin Cross
2017-04-04 12:59:48 -07:00
parent ac01ff5447
commit 3edeee113a
5 changed files with 10 additions and 5 deletions

View File

@@ -204,7 +204,7 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
if ctx.Host() && !binary.static() {
if !ctx.AConfig().IsEnvTrue("DISABLE_HOST_PIE") {
flags.LdFlags = append(flags.LdFlags, "-pie")
if ctx.Os() == android.Windows {
if ctx.Windows() {
flags.LdFlags = append(flags.LdFlags, "-Wl,-e_mainCRTStartup")
}
}
@@ -213,7 +213,7 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
// all code is position independent, and then those warnings get promoted to
// errors.
if ctx.Os() != android.Windows {
if !ctx.Windows() {
flags.CFlags = append(flags.CFlags, "-fpie")
}