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

Commit 0384c973 authored by Aleks Todorov's avatar Aleks Todorov
Browse files

cc: Enable select syntax for cppflags

Bug: 325444956
Test: m
Test: m [custom build target with select in cppflags]
Change-Id: I7d27096526ce5b37afe447f900613a6fbb639986
parent cce2ca72
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ type BaseCompilerProperties struct {
	Cflags proptools.Configurable[[]string] `android:"arch_variant"`

	// list of module-specific flags that will be used for C++ compiles
	Cppflags []string `android:"arch_variant"`
	Cppflags proptools.Configurable[[]string] `android:"arch_variant"`

	// list of module-specific flags that will be used for C compiles
	Conlyflags []string `android:"arch_variant"`
@@ -367,8 +367,9 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
	compiler.srcsBeforeGen = append(compiler.srcsBeforeGen, deps.GeneratedSources...)

	cflags := compiler.Properties.Cflags.GetOrDefault(ctx, nil)
	cppflags := compiler.Properties.Cppflags.GetOrDefault(ctx, nil)
	CheckBadCompilerFlags(ctx, "cflags", cflags)
	CheckBadCompilerFlags(ctx, "cppflags", compiler.Properties.Cppflags)
	CheckBadCompilerFlags(ctx, "cppflags", cppflags)
	CheckBadCompilerFlags(ctx, "conlyflags", compiler.Properties.Conlyflags)
	CheckBadCompilerFlags(ctx, "asflags", compiler.Properties.Asflags)
	CheckBadCompilerFlags(ctx, "vendor.cflags", compiler.Properties.Target.Vendor.Cflags)
@@ -381,7 +382,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
	esc := proptools.NinjaAndShellEscapeList

	flags.Local.CFlags = append(flags.Local.CFlags, esc(cflags)...)
	flags.Local.CppFlags = append(flags.Local.CppFlags, esc(compiler.Properties.Cppflags)...)
	flags.Local.CppFlags = append(flags.Local.CppFlags, esc(cppflags)...)
	flags.Local.ConlyFlags = append(flags.Local.ConlyFlags, esc(compiler.Properties.Conlyflags)...)
	flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Asflags)...)
	flags.Local.YasmFlags = append(flags.Local.YasmFlags, esc(compiler.Properties.Asflags)...)
@@ -808,7 +809,7 @@ type RustBindgenClangProperties struct {

	// list of c++ specific clang flags required to correctly interpret the headers.
	// This is provided primarily to make sure cppflags defined in cc_defaults are pulled in.
	Cppflags []string `android:"arch_variant"`
	Cppflags proptools.Configurable[[]string] `android:"arch_variant"`

	// C standard version to use. Can be a specific version (such as "gnu11"),
	// "experimental" (which will use draft versions like C1x when available),
+1 −1
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) andr
	if isCpp {
		cflags = append(cflags, "-x c++")
		// Add any C++ only flags.
		cflags = append(cflags, esc(b.ClangProperties.Cppflags)...)
		cflags = append(cflags, esc(b.ClangProperties.Cppflags.GetOrDefault(ctx, nil))...)
	} else {
		cflags = append(cflags, "-x c")
	}