Loading cc/builder.go +1 −0 Original line number Diff line number Diff line Loading @@ -354,6 +354,7 @@ type builderFlags struct { protoOptionsFile bool yacc *YaccProperties lex *LexProperties } type StripFlags struct { Loading cc/cc.go +1 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ type Flags struct { protoOptionsFile bool // Whether to look for a .options file next to the .proto Yacc *YaccProperties Lex *LexProperties } // Properties used to compile all C or C++ modules Loading cc/compiler.go +2 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ type BaseCompilerProperties struct { Gnu_extensions *bool Yacc *YaccProperties Lex *LexProperties Aidl struct { // list of directories that will be added to the aidl include paths. Loading Loading @@ -299,6 +300,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Local.YasmFlags = append(flags.Local.YasmFlags, esc(compiler.Properties.Asflags)...) flags.Yacc = compiler.Properties.Yacc flags.Lex = compiler.Properties.Lex // Include dir cflags localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs) Loading cc/gen.go +16 −5 Original line number Diff line number Diff line Loading @@ -34,9 +34,9 @@ func init() { var ( lex = pctx.AndroidStaticRule("lex", blueprint.RuleParams{ Command: "M4=$m4Cmd $lexCmd -o$out $in", Command: "M4=$m4Cmd $lexCmd $flags -o$out $in", CommandDeps: []string{"$lexCmd", "$m4Cmd"}, }) }, "flags") sysprop = pctx.AndroidStaticRule("sysprop", blueprint.RuleParams{ Loading Loading @@ -153,12 +153,23 @@ func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile andr } } func genLex(ctx android.ModuleContext, lexFile android.Path, outFile android.ModuleGenPath) { type LexProperties struct { // list of module-specific flags that will be used for .l and .ll compiles Flags []string } func genLex(ctx android.ModuleContext, lexFile android.Path, outFile android.ModuleGenPath, props *LexProperties) { var flags []string if props != nil { flags = props.Flags } flagsString := strings.Join(flags[:], " ") ctx.Build(pctx, android.BuildParams{ Rule: lex, Description: "lex " + lexFile.Rel(), Output: outFile, Input: lexFile, Args: map[string]string{"flags": flagsString}, }) } Loading Loading @@ -235,11 +246,11 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths, case ".l": cFile := android.GenPathWithExt(ctx, "lex", srcFile, "c") srcFiles[i] = cFile genLex(ctx, srcFile, cFile) genLex(ctx, srcFile, cFile, buildFlags.lex) case ".ll": cppFile := android.GenPathWithExt(ctx, "lex", srcFile, "cpp") srcFiles[i] = cppFile genLex(ctx, srcFile, cppFile) genLex(ctx, srcFile, cppFile, buildFlags.lex) case ".proto": ccFile, headerFile := genProto(ctx, srcFile, buildFlags) srcFiles[i] = ccFile Loading cc/util.go +1 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ func flagsToBuilderFlags(in Flags) builderFlags { protoOptionsFile: in.protoOptionsFile, yacc: in.Yacc, lex: in.Lex, } } Loading Loading
cc/builder.go +1 −0 Original line number Diff line number Diff line Loading @@ -354,6 +354,7 @@ type builderFlags struct { protoOptionsFile bool yacc *YaccProperties lex *LexProperties } type StripFlags struct { Loading
cc/cc.go +1 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ type Flags struct { protoOptionsFile bool // Whether to look for a .options file next to the .proto Yacc *YaccProperties Lex *LexProperties } // Properties used to compile all C or C++ modules Loading
cc/compiler.go +2 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ type BaseCompilerProperties struct { Gnu_extensions *bool Yacc *YaccProperties Lex *LexProperties Aidl struct { // list of directories that will be added to the aidl include paths. Loading Loading @@ -299,6 +300,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Local.YasmFlags = append(flags.Local.YasmFlags, esc(compiler.Properties.Asflags)...) flags.Yacc = compiler.Properties.Yacc flags.Lex = compiler.Properties.Lex // Include dir cflags localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs) Loading
cc/gen.go +16 −5 Original line number Diff line number Diff line Loading @@ -34,9 +34,9 @@ func init() { var ( lex = pctx.AndroidStaticRule("lex", blueprint.RuleParams{ Command: "M4=$m4Cmd $lexCmd -o$out $in", Command: "M4=$m4Cmd $lexCmd $flags -o$out $in", CommandDeps: []string{"$lexCmd", "$m4Cmd"}, }) }, "flags") sysprop = pctx.AndroidStaticRule("sysprop", blueprint.RuleParams{ Loading Loading @@ -153,12 +153,23 @@ func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile andr } } func genLex(ctx android.ModuleContext, lexFile android.Path, outFile android.ModuleGenPath) { type LexProperties struct { // list of module-specific flags that will be used for .l and .ll compiles Flags []string } func genLex(ctx android.ModuleContext, lexFile android.Path, outFile android.ModuleGenPath, props *LexProperties) { var flags []string if props != nil { flags = props.Flags } flagsString := strings.Join(flags[:], " ") ctx.Build(pctx, android.BuildParams{ Rule: lex, Description: "lex " + lexFile.Rel(), Output: outFile, Input: lexFile, Args: map[string]string{"flags": flagsString}, }) } Loading Loading @@ -235,11 +246,11 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths, case ".l": cFile := android.GenPathWithExt(ctx, "lex", srcFile, "c") srcFiles[i] = cFile genLex(ctx, srcFile, cFile) genLex(ctx, srcFile, cFile, buildFlags.lex) case ".ll": cppFile := android.GenPathWithExt(ctx, "lex", srcFile, "cpp") srcFiles[i] = cppFile genLex(ctx, srcFile, cppFile) genLex(ctx, srcFile, cppFile, buildFlags.lex) case ".proto": ccFile, headerFile := genProto(ctx, srcFile, buildFlags) srcFiles[i] = ccFile Loading
cc/util.go +1 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ func flagsToBuilderFlags(in Flags) builderFlags { protoOptionsFile: in.protoOptionsFile, yacc: in.Yacc, lex: in.Lex, } } Loading