aboutsummaryrefslogtreecommitdiffstats
path: root/cc/ndk_library.go
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2017-03-29 18:22:39 -0700
committerDan Albert <danalbert@google.com>2017-03-31 16:19:51 -0700
commit2e5d7d41f483d46508d7d7b23f65219fc8821000 (patch)
tree27feaf615234398856b23f415a71a97ddafbb426 /cc/ndk_library.go
parent30c9d6e771ef76c4f809b0674ee9a3edd2aa88ab (diff)
downloadbuild_soong-2e5d7d41f483d46508d7d7b23f65219fc8821000.tar.gz
build_soong-2e5d7d41f483d46508d7d7b23f65219fc8821000.tar.bz2
build_soong-2e5d7d41f483d46508d7d7b23f65219fc8821000.zip
Add `sdk_version: "minimum"`.
This maps to the lowest supported API level for the given architecture. Test: make checkbuild # after setting some things to use this Bug: None Change-Id: Ied6d44cb2719b73f35dde38a2dca6d3c87c7c924
Diffstat (limited to 'cc/ndk_library.go')
-rw-r--r--cc/ndk_library.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index 6ebd0c46..c28b411d 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -130,6 +130,16 @@ func normalizeNdkApiLevel(apiLevel string, arch android.Arch) (string, error) {
"x86_64": 21,
}
+ archStr := arch.ArchType.String()
+ firstArchVersion, ok := firstArchVersions[archStr]
+ if !ok {
+ panic(fmt.Errorf("Arch %q not found in firstArchVersions", archStr))
+ }
+
+ if apiLevel == "minimum" {
+ return strconv.Itoa(firstArchVersion), nil
+ }
+
// If the NDK drops support for a platform version, we don't want to have to
// fix up every module that was using it as its SDK version. Clip to the
// supported version here instead.
@@ -139,12 +149,6 @@ func normalizeNdkApiLevel(apiLevel string, arch android.Arch) (string, error) {
}
version = intMax(version, minVersion)
- archStr := arch.ArchType.String()
- firstArchVersion, ok := firstArchVersions[archStr]
- if !ok {
- panic(fmt.Errorf("Arch %q not found in firstArchVersions", archStr))
- }
-
return strconv.Itoa(intMax(version, firstArchVersion)), nil
}