diff options
| author | 2021-03-18 16:56:36 -0400 | |
|---|---|---|
| committer | 2021-03-19 12:33:34 -0400 | |
| commit | a4aa43072bb6253f9f360ee1f77fe37ccf82057c (patch) | |
| tree | afcee7ed8a4172b62d8f183d5d2f794a2ba2d5ed /cc/compiler.go | |
| parent | 45a497180892a47cd69758b9d9126b7c608485ce (diff) | |
Handle include_build_directory prop in bp2build
Test: go test cc tests
Test: generate bp2build, sync bp2build, bazel build //bionic/...
Bug: 181794963
Change-Id: I8dcef585e3025ef6f44d22430ed67b1e0429dca0
Diffstat (limited to 'cc/compiler.go')
| -rw-r--r-- | cc/compiler.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cc/compiler.go b/cc/compiler.go index 2e71922e1..791c95b24 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -256,6 +256,10 @@ func (compiler *baseCompiler) compilerProps() []interface{} { return []interface{}{&compiler.Properties, &compiler.Proto} } +func (compiler *baseCompiler) includeBuildDirectory() bool { + return proptools.BoolDefault(compiler.Properties.Include_build_directory, true) +} + func (compiler *baseCompiler) compilerInit(ctx BaseModuleContext) {} func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { @@ -332,8 +336,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Local.YasmFlags = append(flags.Local.YasmFlags, f) } - if compiler.Properties.Include_build_directory == nil || - *compiler.Properties.Include_build_directory { + if compiler.includeBuildDirectory() { flags.Local.CommonFlags = append(flags.Local.CommonFlags, "-I"+modulePath) flags.Local.YasmFlags = append(flags.Local.YasmFlags, "-I"+modulePath) } |