Split local/absolute include into attributes
Previously these were expanded into copts, requiring making all includes
absolute and duplicating includes to account for potentially generated
files. We now can handle both of these properly on the Bazel side, so
let's clean up build files a bit.
Test: bp2build.sh
Change-Id: I6c6160738cd6c269408c6c7a37010654d84f3c9d
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index c2c35e7..371593b 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -255,13 +255,11 @@
blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "fake-libarm-optimized-routines-math",
- copts = [
- "-Iexternal",
- "-I$(BINDIR)/external",
- ] + select({
+ copts = select({
"//build/bazel/platforms/arch:arm64": ["-DHAVE_FAST_FMA=1"],
"//conditions:default": [],
}),
+ local_includes = ["."],
srcs_c = ["math/cosf.c"],
)`},
})
@@ -494,12 +492,9 @@
blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "bothflag",
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
+ copts = ["bothflag"],
implementation_deps = [":static_dep_for_both"],
+ local_includes = ["."],
shared = {
"copts": ["sharedflag"] + select({
"//build/bazel/platforms/arch:arm": ["-DARM_SHARED"],
@@ -635,14 +630,7 @@
blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- asflags = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
+ local_includes = ["."],
shared = {
"srcs": [
":shared_filegroup_cpp_srcs",