Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e0aa23d authored by Dan Willemsen's avatar Dan Willemsen
Browse files

Convert yacc to a single RuleBuilder rule

So that <module>/gen/yacc/... is (re)created by a single rule, previous
files are removed, and location.hh is in the build graph when it is
produced.

Test: treehugger
Change-Id: I2f6e47ea07f315e10ae1cb8ad50697e7123d0285
parent 633c5022
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -405,6 +405,10 @@ func (c *config) GoRoot() string {
	return fmt.Sprintf("%s/prebuilts/go/%s", c.srcDir, c.PrebuiltOS())
}

func (c *config) PrebuiltBuildTool(ctx PathContext, tool string) Path {
	return PathForSource(ctx, "prebuilts/build-tools", c.PrebuiltOS(), "bin", tool)
}

func (c *config) CpPreserveSymlinksFlags() string {
	switch runtime.GOOS {
	case "darwin":
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ func init() {
			"LOCAL_OVERRIDES_MODULES":             "overrides",
			"LOCAL_LDLIBS":                        "host_ldlibs",
			"LOCAL_CLANG_CFLAGS":                  "clang_cflags",
			"LOCAL_YACCFLAGS":                     "yaccflags",
			"LOCAL_YACCFLAGS":                     "yacc.flags",
			"LOCAL_SANITIZE_RECOVER":              "sanitize.recover",
			"LOCAL_LOGTAGS_FILES":                 "logtags",
			"LOCAL_EXPORT_HEADER_LIBRARY_HEADERS": "export_header_lib_headers",
+2 −1
Original line number Diff line number Diff line
@@ -239,7 +239,6 @@ type builderFlags struct {
	cppFlags        string
	ldFlags         string
	libFlags        string
	yaccFlags       string
	tidyFlags       string
	sAbiFlags       string
	yasmFlags       string
@@ -262,6 +261,8 @@ type builderFlags struct {
	proto            android.ProtoFlags
	protoC           bool
	protoOptionsFile bool

	yacc *YaccProperties
}

type Objects struct {
+2 −1
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ type Flags struct {
	ConlyFlags      []string // Flags that apply to C source files
	CppFlags        []string // Flags that apply to C++ source files
	ToolingCppFlags []string // Flags that apply to C++ source files parsed by clang LibTooling tools
	YaccFlags       []string // Flags that apply to Yacc source files
	aidlFlags       []string // Flags that apply to aidl source files
	rsFlags         []string // Flags that apply to renderscript source files
	LdFlags         []string // Flags that apply to linker command lines
@@ -165,6 +164,8 @@ type Flags struct {
	proto            android.ProtoFlags
	protoC           bool // Whether to use C instead of C++
	protoOptionsFile bool // Whether to look for a .options file next to the .proto

	Yacc *YaccProperties
}

type ObjectLinkerProperties struct {
+4 −4
Original line number Diff line number Diff line
@@ -57,9 +57,6 @@ type BaseCompilerProperties struct {
	// compiling with clang
	Clang_asflags []string `android:"arch_variant"`

	// list of module-specific flags that will be used for .y and .yy compiles
	Yaccflags []string

	// the instruction set architecture to use to compile the C/C++
	// module.
	Instruction_set *string `android:"arch_variant"`
@@ -103,6 +100,8 @@ type BaseCompilerProperties struct {
	// if set to false, use -std=c++* instead of -std=gnu++*
	Gnu_extensions *bool

	Yacc *YaccProperties

	Aidl struct {
		// list of directories that will be added to the aidl include paths.
		Include_dirs []string
@@ -275,7 +274,8 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
	flags.ConlyFlags = append(flags.ConlyFlags, esc(compiler.Properties.Conlyflags)...)
	flags.AsFlags = append(flags.AsFlags, esc(compiler.Properties.Asflags)...)
	flags.YasmFlags = append(flags.YasmFlags, esc(compiler.Properties.Asflags)...)
	flags.YaccFlags = append(flags.YaccFlags, esc(compiler.Properties.Yaccflags)...)

	flags.Yacc = compiler.Properties.Yacc

	// Include dir cflags
	localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs)
Loading