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
This commit is contained in:
@@ -18,6 +18,8 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"android/soong/starlark_fmt"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -380,3 +382,21 @@ func (a *apiLevelsSingleton) GenerateBuildActions(ctx SingletonContext) {
|
||||
apiLevelsJson := GetApiLevelsJson(ctx)
|
||||
createApiLevelsJson(ctx, apiLevelsJson, apiLevelsMap)
|
||||
}
|
||||
|
||||
func printApiLevelsStarlarkDict(config Config) string {
|
||||
apiLevelsMap := GetApiLevelsMap(config)
|
||||
valDict := make(map[string]string, len(apiLevelsMap))
|
||||
for k, v := range apiLevelsMap {
|
||||
valDict[k] = strconv.Itoa(v)
|
||||
}
|
||||
return starlark_fmt.PrintDict(valDict, 0)
|
||||
}
|
||||
|
||||
func StarlarkApiLevelConfigs(config Config) string {
|
||||
return fmt.Sprintf(`# GENERATED FOR BAZEL FROM SOONG. DO NOT EDIT.
|
||||
_api_levels = %s
|
||||
|
||||
api_levels = _api_levels
|
||||
`, printApiLevelsStarlarkDict(config),
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user