diff options
author | Dan Albert <danalbert@google.com> | 2017-08-17 16:19:59 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2017-08-17 16:54:03 -0700 |
commit | f5415d7cc68d84d9f5183f48498011675a19df47 (patch) | |
tree | a6ec94a4c74a084ab4455f17f768a0e6cee91e8c /cc/ndk_library.go | |
parent | b90afd09d6a5ee5b3b99d9af772f92b005cc39b0 (diff) | |
download | build_soong-f5415d7cc68d84d9f5183f48498011675a19df47.tar.gz build_soong-f5415d7cc68d84d9f5183f48498011675a19df47.tar.bz2 build_soong-f5415d7cc68d84d9f5183f48498011675a19df47.zip |
Expose the minimum supported SDK version to make.
Right now this is hard coded in two places (here and in
core/binary.mk). Keep it in one place so it's easier to change.
Test: make checkbuild
Bug: None
Change-Id: I2a2c784d4c667b326f871e6144db92753c16c85f
Diffstat (limited to 'cc/ndk_library.go')
-rw-r--r-- | cc/ndk_library.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 8fbffcf0..fc7cd918 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -110,18 +110,20 @@ func intMax(a int, b int) int { } } -func normalizeNdkApiLevel(apiLevel string, arch android.Arch) (string, error) { +func normalizeNdkApiLevel(ctx android.BaseContext, apiLevel string, + arch android.Arch) (string, error) { + if apiLevel == "current" { return apiLevel, nil } - minVersion := 9 // Minimum version supported by the NDK. + minVersion := ctx.AConfig().MinSupportedSdkVersion() firstArchVersions := map[android.ArchType]int{ - android.Arm: 9, + android.Arm: minVersion, android.Arm64: 21, - android.Mips: 9, + android.Mips: minVersion, android.Mips64: 21, - android.X86: 9, + android.X86: minVersion, android.X86_64: 21, } @@ -188,7 +190,7 @@ func shouldUseVersionScript(stub *stubDecorator) (bool, error) { func generateStubApiVariants(mctx android.BottomUpMutatorContext, c *stubDecorator) { platformVersion := mctx.AConfig().PlatformSdkVersionInt() - firstSupportedVersion, err := normalizeNdkApiLevel(c.properties.First_version, + firstSupportedVersion, err := normalizeNdkApiLevel(mctx, c.properties.First_version, mctx.Arch()) if err != nil { mctx.PropertyErrorf("first_version", err.Error()) |