Merge "Initial Fuchsia support."

This commit is contained in:
Doug Horn
2019-01-17 20:37:27 +00:00
committed by Gerrit Code Review
4 changed files with 19 additions and 1 deletions

View File

@@ -391,6 +391,7 @@ var (
LinuxBionic = NewOsType("linux_bionic", Host, false) LinuxBionic = NewOsType("linux_bionic", Host, false)
Windows = NewOsType("windows", HostCross, true) Windows = NewOsType("windows", HostCross, true)
Android = NewOsType("android", Device, false) Android = NewOsType("android", Device, false)
Fuchsia = NewOsType("fuchsia", Device, false)
osArchTypeMap = map[OsType][]ArchType{ osArchTypeMap = map[OsType][]ArchType{
Linux: []ArchType{X86, X86_64}, Linux: []ArchType{X86, X86_64},
@@ -398,6 +399,7 @@ var (
Darwin: []ArchType{X86_64}, Darwin: []ArchType{X86_64},
Windows: []ArchType{X86, X86_64}, Windows: []ArchType{X86, X86_64},
Android: []ArchType{Arm, Arm64, Mips, Mips64, X86, X86_64}, Android: []ArchType{Arm, Arm64, Mips, Mips64, X86, X86_64},
Fuchsia: []ArchType{Arm64, X86_64},
} }
) )
@@ -1191,7 +1193,12 @@ func decodeTargetProductVariables(config *config) (map[OsType][]Target, error) {
} }
if variables.DeviceArch != nil && *variables.DeviceArch != "" { if variables.DeviceArch != nil && *variables.DeviceArch != "" {
addTarget(Android, *variables.DeviceArch, variables.DeviceArchVariant, var target = Android
if Bool(variables.Fuchsia) {
target = Fuchsia
}
addTarget(target, *variables.DeviceArch, variables.DeviceArchVariant,
variables.DeviceCpuVariant, variables.DeviceAbi) variables.DeviceCpuVariant, variables.DeviceAbi)
if variables.DeviceSecondaryArch != nil && *variables.DeviceSecondaryArch != "" { if variables.DeviceSecondaryArch != nil && *variables.DeviceSecondaryArch != "" {

View File

@@ -586,6 +586,10 @@ func (c *config) UnbundledBuildPrebuiltSdks() bool {
return Bool(c.productVariables.Unbundled_build) && !Bool(c.productVariables.Unbundled_build_sdks_from_source) return Bool(c.productVariables.Unbundled_build) && !Bool(c.productVariables.Unbundled_build_sdks_from_source)
} }
func (c *config) Fuchsia() bool {
return Bool(c.productVariables.Fuchsia)
}
func (c *config) IsPdkBuild() bool { func (c *config) IsPdkBuild() bool {
return Bool(c.productVariables.Pdk) return Bool(c.productVariables.Pdk)
} }

View File

@@ -64,6 +64,7 @@ type androidBaseContext interface {
Host() bool Host() bool
Device() bool Device() bool
Darwin() bool Darwin() bool
Fuchsia() bool
Windows() bool Windows() bool
Debug() bool Debug() bool
PrimaryArch() bool PrimaryArch() bool
@@ -1121,6 +1122,10 @@ func (a *androidBaseContextImpl) Darwin() bool {
return a.target.Os == Darwin return a.target.Os == Darwin
} }
func (a *androidBaseContextImpl) Fuchsia() bool {
return a.target.Os == Fuchsia
}
func (a *androidBaseContextImpl) Windows() bool { func (a *androidBaseContextImpl) Windows() bool {
return a.target.Os == Windows return a.target.Os == Windows
} }

View File

@@ -243,6 +243,8 @@ type productVariables struct {
Product_is_iot *bool `json:",omitempty"` Product_is_iot *bool `json:",omitempty"`
Fuchsia *bool `json:",omitempty"`
DeviceKernelHeaders []string `json:",omitempty"` DeviceKernelHeaders []string `json:",omitempty"`
ExtraVndkVersions []string `json:",omitempty"` ExtraVndkVersions []string `json:",omitempty"`