Support tailoring clang --target flag based on min sdk version.
Bug: 215748260
Test: Tested using aquery to verify the --target flag; add added unit
Change-Id: Ifb13509db7d1e110316aa44d55ec9cccaa4b83d1
diff --git a/cc/bp2build.go b/cc/bp2build.go
index 379d6f2..93d11c7 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -52,6 +52,8 @@
System_dynamic_deps bazel.LabelListAttribute
Enabled bazel.BoolAttribute
+
+ sdkAttributes
}
// groupSrcsByExtension partitions `srcs` into groups based on file extension.
@@ -539,6 +541,18 @@
}
}
+func bp2BuildParseSdkAttributes(module *Module) sdkAttributes {
+ return sdkAttributes {
+ Sdk_version: module.Properties.Sdk_version,
+ Min_sdk_version: module.Properties.Min_sdk_version,
+ }
+}
+
+type sdkAttributes struct {
+ Sdk_version *string
+ Min_sdk_version *string
+}
+
// Convenience struct to hold all attributes parsed from linker properties.
type linkerAttributes struct {
deps bazel.LabelListAttribute