Compare commits
8 commits
876f0bb0d9
...
c38f67a21e
Author | SHA1 | Date | |
---|---|---|---|
|
c38f67a21e | ||
|
fa05ec8e2f | ||
|
73e6bfc947 | ||
|
e8a02794af | ||
|
f563943c6b | ||
|
8c89318cd2 | ||
|
7afb23c3c9 | ||
|
639cd2ce78 |
7 changed files with 95 additions and 0 deletions
|
@ -156,6 +156,9 @@ func (r *NameResolver) addNamespace(namespace *Namespace) (err error) {
|
|||
return fmt.Errorf("a namespace must be the first module in the file")
|
||||
}
|
||||
}
|
||||
if (namespace.exportToKati) {
|
||||
r.rootNamespace.visibleNamespaces = append(r.rootNamespace.visibleNamespaces, namespace)
|
||||
}
|
||||
r.sortedNamespaces.add(namespace)
|
||||
|
||||
r.namespacesByDir.Store(namespace.Path, namespace)
|
||||
|
|
|
@ -1145,6 +1145,31 @@ func pathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error
|
|||
return ret, nil
|
||||
}
|
||||
|
||||
// pathForSourceRelaxed creates a SourcePath from pathComponents, but does not check that it exists.
|
||||
// It differs from pathForSource in that the path is allowed to exist outside of the PathContext.
|
||||
func pathForSourceRelaxed(ctx PathContext, pathComponents ...string) (SourcePath, error) {
|
||||
p := filepath.Join(pathComponents...)
|
||||
ret := SourcePath{basePath{p, ""}}
|
||||
|
||||
abs, err := filepath.Abs(ret.String())
|
||||
if err != nil {
|
||||
return ret, err
|
||||
}
|
||||
buildroot, err := filepath.Abs(ctx.Config().soongOutDir)
|
||||
if err != nil {
|
||||
return ret, err
|
||||
}
|
||||
if strings.HasPrefix(abs, buildroot) {
|
||||
return ret, fmt.Errorf("source path %s is in output", abs)
|
||||
}
|
||||
|
||||
if pathtools.IsGlob(ret.String()) {
|
||||
return ret, fmt.Errorf("path may not contain a glob: %s", ret.String())
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
// existsWithDependencies returns true if the path exists, and adds appropriate dependencies to rerun if the
|
||||
// path does not exist.
|
||||
func existsWithDependencies(ctx PathGlobContext, path SourcePath) (exists bool, err error) {
|
||||
|
@ -1190,6 +1215,31 @@ func PathForSource(ctx PathContext, pathComponents ...string) SourcePath {
|
|||
return path
|
||||
}
|
||||
|
||||
// PathForSourceRelaxed joins the provided path components. Unlike PathForSource,
|
||||
// the result is allowed to exist outside of the source dir.
|
||||
// On error, it will return a usable, but invalid SourcePath, and report a ModuleError.
|
||||
func PathForSourceRelaxed(ctx PathContext, pathComponents ...string) SourcePath {
|
||||
path, err := pathForSourceRelaxed(ctx, pathComponents...)
|
||||
if err != nil {
|
||||
reportPathError(ctx, err)
|
||||
}
|
||||
|
||||
if modCtx, ok := ctx.(ModuleContext); ok && ctx.Config().AllowMissingDependencies() {
|
||||
exists, err := existsWithDependencies(modCtx, path)
|
||||
if err != nil {
|
||||
reportPathError(ctx, err)
|
||||
}
|
||||
if !exists {
|
||||
modCtx.AddMissingDependencies([]string{path.String()})
|
||||
}
|
||||
} else if exists, _, err := ctx.Config().fs.Exists(path.String()); err != nil {
|
||||
ReportPathErrorf(ctx, "%s: %s", path, err.Error())
|
||||
} else if !exists {
|
||||
ReportPathErrorf(ctx, "source path %s does not exist", path)
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
// PathForArbitraryOutput creates a path for the given components. Unlike PathForOutput,
|
||||
// the path is relative to the root of the output folder, not the out/soong folder.
|
||||
func PathForArbitraryOutput(ctx PathContext, pathComponents ...string) Path {
|
||||
|
|
|
@ -150,6 +150,7 @@ type variableProperties struct {
|
|||
Eng struct {
|
||||
Cflags []string
|
||||
Cppflags []string
|
||||
Init_rc []string
|
||||
Lto struct {
|
||||
Never *bool
|
||||
}
|
||||
|
|
|
@ -762,6 +762,13 @@ func cflags(ctx variableAssignmentContext) error {
|
|||
return includeVariableNow(bpVariable{"cflags", bpparser.ListType}, ctx)
|
||||
}
|
||||
|
||||
func exportCflags(ctx variableAssignmentContext) error {
|
||||
// The Soong replacement for EXPORT_CFLAGS doesn't need the same extra escaped quotes that were present in Make
|
||||
ctx.mkvalue = ctx.mkvalue.Clone()
|
||||
ctx.mkvalue.ReplaceLiteral(`\"`, `"`)
|
||||
return includeVariableNow(bpVariable{"export_cflags", bpparser.ListType}, ctx)
|
||||
}
|
||||
|
||||
func protoOutputParams(ctx variableAssignmentContext) error {
|
||||
// The Soong replacement for LOCAL_PROTO_JAVA_OUTPUT_PARAMS doesn't need ","
|
||||
ctx.mkvalue = ctx.mkvalue.Clone()
|
||||
|
|
17
cc/cc.go
17
cc/cc.go
|
@ -2468,6 +2468,23 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
|
|||
variantNdkLibs := []string{}
|
||||
variantLateNdkLibs := []string{}
|
||||
if ctx.Os() == android.Android {
|
||||
rewriteHeaderLibs := func(list []string) (newHeaderLibs []string) {
|
||||
newHeaderLibs = []string{}
|
||||
for _, entry := range list {
|
||||
// Replace device_kernel_headers with generated_kernel_headers
|
||||
// for inline kernel building
|
||||
if entry == "device_kernel_headers" || entry == "qti_kernel_headers" {
|
||||
if (ctx.Config().Getenv("INLINE_KERNEL_BUILDING") == "true") {
|
||||
newHeaderLibs = append(newHeaderLibs, "generated_kernel_headers")
|
||||
continue
|
||||
}
|
||||
}
|
||||
newHeaderLibs = append(newHeaderLibs, entry)
|
||||
}
|
||||
return newHeaderLibs
|
||||
}
|
||||
deps.HeaderLibs = rewriteHeaderLibs(deps.HeaderLibs)
|
||||
|
||||
deps.SharedLibs, variantNdkLibs = FilterNdkLibs(c, ctx.Config(), deps.SharedLibs)
|
||||
deps.LateSharedLibs, variantLateNdkLibs = FilterNdkLibs(c, ctx.Config(), deps.LateSharedLibs)
|
||||
deps.ReexportSharedLibHeaders, _ = FilterNdkLibs(c, ctx.Config(), deps.ReexportSharedLibHeaders)
|
||||
|
|
|
@ -196,6 +196,9 @@ type FlagExporterProperties struct {
|
|||
// using -isystem for this module and any module that links against this module.
|
||||
Export_system_include_dirs []string `android:"arch_variant,variant_prepend"`
|
||||
|
||||
// list of plain cc flags to be used for any module that links against this module.
|
||||
Export_cflags []string `android:"arch_variant"`
|
||||
|
||||
Target struct {
|
||||
Vendor, Product struct {
|
||||
// list of exported include directories, like
|
||||
|
@ -306,6 +309,10 @@ func (f *flagExporter) exportIncludes(ctx ModuleContext) {
|
|||
f.systemDirs = append(f.systemDirs, android.PathsForModuleSrc(ctx, f.Properties.Export_system_include_dirs)...)
|
||||
}
|
||||
|
||||
func (f *flagExporter) exportExtraFlags(ctx ModuleContext) {
|
||||
f.flags = append(f.flags, f.Properties.Export_cflags...)
|
||||
}
|
||||
|
||||
// exportIncludesAsSystem registers the include directories and system include directories to be
|
||||
// exported transitively both as system include directories to modules depending on this module.
|
||||
func (f *flagExporter) exportIncludesAsSystem(ctx ModuleContext) {
|
||||
|
@ -1630,6 +1637,7 @@ func (library *libraryDecorator) link(ctx ModuleContext,
|
|||
|
||||
// Export include paths and flags to be propagated up the tree.
|
||||
library.exportIncludes(ctx)
|
||||
library.exportExtraFlags(ctx)
|
||||
library.reexportDirs(deps.ReexportedDirs...)
|
||||
library.reexportSystemDirs(deps.ReexportedSystemDirs...)
|
||||
library.reexportFlags(deps.ReexportedFlags...)
|
||||
|
|
|
@ -258,3 +258,12 @@ com\.google\.i18n\.phonenumbers
|
|||
# Packages used for Android in Chrome OS
|
||||
org\.chromium\.arc
|
||||
org\.chromium\.arc\..*
|
||||
|
||||
# QC adds
|
||||
com.qualcomm.qti
|
||||
com.quicinc.tcmiface
|
||||
com.qualcomm.wfd
|
||||
com.qualcomm.wfd.service
|
||||
org.codeaurora.ims
|
||||
org.codeaurora.internal
|
||||
qcom.fmradio
|
||||
|
|
Loading…
Reference in a new issue