Loading android/proto.go +17 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,7 @@ package android // generate the source. func ProtoFlags(ctx ModuleContext, p *ProtoProperties) []string { // -I . must come first, it affects where protoc places the output files. protoFlags := []string{"-I ."} protoFlags := []string{} if len(p.Proto.Local_include_dirs) > 0 { localProtoIncludeDirs := PathsForModuleSrc(ctx, p.Proto.Local_include_dirs) Loading @@ -38,6 +37,13 @@ func ProtoFlags(ctx ModuleContext, p *ProtoProperties) []string { return protoFlags } func ProtoCanonicalPathFromRoot(ctx ModuleContext, p *ProtoProperties) bool { if p.Proto.Canonical_path_from_root == nil { return true } return *p.Proto.Canonical_path_from_root } // ProtoDir returns the module's "gen/proto" directory func ProtoDir(ctx ModuleContext) ModuleGenPath { return PathForModuleGen(ctx, "proto") Loading @@ -59,5 +65,14 @@ type ProtoProperties struct { // list of directories relative to the bp file that will // be added to the protoc include paths. Local_include_dirs []string // whether to identify the proto files from the root of the // source tree (the original method in Android, useful for // android-specific protos), or relative from where they were // specified (useful for external/third party protos). // // This defaults to true today, but is expected to default to // false in the future. Canonical_path_from_root *bool } `android:"arch_variant"` } cc/builder.go +1 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ type builderFlags struct { tidy bool coverage bool sAbiDump bool protoRoot bool systemIncludeFlags string Loading cc/cc.go +1 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ type Flags struct { Tidy bool Coverage bool SAbiDump bool ProtoRoot bool RequiredInstructionSet string DynamicLinker string Loading cc/gen.go +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths, genLex(ctx, srcFile, cppFile) case ".proto": ccFile, headerFile := genProto(ctx, srcFile, buildFlags.protoFlags, buildFlags.protoOutParams) buildFlags.protoOutParams, buildFlags.protoRoot) srcFiles[i] = ccFile deps = append(deps, headerFile) case ".aidl": Loading cc/library.go +6 −5 Original line number Diff line number Diff line Loading @@ -690,12 +690,13 @@ func (library *libraryDecorator) link(ctx ModuleContext, if Bool(library.Properties.Proto.Export_proto_headers) { if library.baseCompiler.hasSrcExt(".proto") { flags := []string{ "-I" + android.ProtoSubDir(ctx).String(), "-I" + android.ProtoDir(ctx).String(), includes := []string{} if flags.ProtoRoot { includes = append(includes, "-I"+android.ProtoSubDir(ctx).String()) } library.reexportFlags(flags) library.reuseExportedFlags = append(library.reuseExportedFlags, flags...) includes = append(includes, "-I"+android.ProtoDir(ctx).String()) library.reexportFlags(includes) library.reuseExportedFlags = append(library.reuseExportedFlags, includes...) library.reexportDeps(library.baseCompiler.pathDeps) // TODO: restrict to proto deps library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.pathDeps...) } Loading Loading
android/proto.go +17 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,7 @@ package android // generate the source. func ProtoFlags(ctx ModuleContext, p *ProtoProperties) []string { // -I . must come first, it affects where protoc places the output files. protoFlags := []string{"-I ."} protoFlags := []string{} if len(p.Proto.Local_include_dirs) > 0 { localProtoIncludeDirs := PathsForModuleSrc(ctx, p.Proto.Local_include_dirs) Loading @@ -38,6 +37,13 @@ func ProtoFlags(ctx ModuleContext, p *ProtoProperties) []string { return protoFlags } func ProtoCanonicalPathFromRoot(ctx ModuleContext, p *ProtoProperties) bool { if p.Proto.Canonical_path_from_root == nil { return true } return *p.Proto.Canonical_path_from_root } // ProtoDir returns the module's "gen/proto" directory func ProtoDir(ctx ModuleContext) ModuleGenPath { return PathForModuleGen(ctx, "proto") Loading @@ -59,5 +65,14 @@ type ProtoProperties struct { // list of directories relative to the bp file that will // be added to the protoc include paths. Local_include_dirs []string // whether to identify the proto files from the root of the // source tree (the original method in Android, useful for // android-specific protos), or relative from where they were // specified (useful for external/third party protos). // // This defaults to true today, but is expected to default to // false in the future. Canonical_path_from_root *bool } `android:"arch_variant"` }
cc/builder.go +1 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ type builderFlags struct { tidy bool coverage bool sAbiDump bool protoRoot bool systemIncludeFlags string Loading
cc/cc.go +1 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ type Flags struct { Tidy bool Coverage bool SAbiDump bool ProtoRoot bool RequiredInstructionSet string DynamicLinker string Loading
cc/gen.go +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths, genLex(ctx, srcFile, cppFile) case ".proto": ccFile, headerFile := genProto(ctx, srcFile, buildFlags.protoFlags, buildFlags.protoOutParams) buildFlags.protoOutParams, buildFlags.protoRoot) srcFiles[i] = ccFile deps = append(deps, headerFile) case ".aidl": Loading
cc/library.go +6 −5 Original line number Diff line number Diff line Loading @@ -690,12 +690,13 @@ func (library *libraryDecorator) link(ctx ModuleContext, if Bool(library.Properties.Proto.Export_proto_headers) { if library.baseCompiler.hasSrcExt(".proto") { flags := []string{ "-I" + android.ProtoSubDir(ctx).String(), "-I" + android.ProtoDir(ctx).String(), includes := []string{} if flags.ProtoRoot { includes = append(includes, "-I"+android.ProtoSubDir(ctx).String()) } library.reexportFlags(flags) library.reuseExportedFlags = append(library.reuseExportedFlags, flags...) includes = append(includes, "-I"+android.ProtoDir(ctx).String()) library.reexportFlags(includes) library.reuseExportedFlags = append(library.reuseExportedFlags, includes...) library.reexportDeps(library.baseCompiler.pathDeps) // TODO: restrict to proto deps library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.pathDeps...) } Loading