aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2019-10-03 15:55:57 -0700
committerDan Albert <danalbert@google.com>2019-10-03 16:27:03 -0700
commitbe4034163b8c0a325b42070c9260a8f205efb2ea (patch)
tree93fd7e0d524298a3f650cfbb64dc8c5bebf46e56 /docs
parentd68585a19358d55940bd974e012784f8593eada5 (diff)
downloadndk-be4034163b8c0a325b42070c9260a8f205efb2ea.tar.gz
Add ndk-major-at-least API to ndk-build.
Gives apps a standard way to check if their NDK is at least a certain version from ndk-build. CMake has had this for quite some time. Test: manual Bug: None Change-Id: I02bb2a141ede2270c71f0044e6c432097ebda4e0
Diffstat (limited to 'docs')
-rw-r--r--docs/changelogs/Changelog-r21.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/changelogs/Changelog-r21.md b/docs/changelogs/Changelog-r21.md
index 30fb9df48..e42e210f6 100644
--- a/docs/changelogs/Changelog-r21.md
+++ b/docs/changelogs/Changelog-r21.md
@@ -72,6 +72,27 @@ For Android Studio issues, follow the docs on the [Android Studio site].
* Added `NDK_GRADLE_INJECTED_IMPORT_PATH` support to ndk-build. This is to
support import of dependencies from AAR dependencies. See [Issue 916] for
more information.
+ * Added `NDK_MAJOR`, `NDK_MINOR`, `NDK_BETA`, `NDK_CANARY`, and
+ `ndk-major-at-least` APIs to ndk-build. These can be used to check what
+ version of the NDK you are using from within ndk-build (CMake already has
+ equivalent APIs). The first three are integers, `NDK_CANARY` is either `true`
+ or `false`, and `ndk-major-at-least` is a function that takes a single
+ integer. For example, to check if your build is being performed with NDK r21
+ or newer:
+
+ ```makefile
+ ifeq ($(call ndk-major-at-least,21),true)
+ # Using at least NDK r21.
+ else
+ # Using something earlier than r21.
+ endif
+ ```
+
+ Note that because this API was not available before r21, it cannot be used to
+ determine *which* NDK version earlier than 21 is being used, so this API is
+ of limited use today. Also note that the above code will behave correctly
+ even on pre-r21 because calling an undefined function in make returns the
+ empty string, so the else case will be taken.
[FORTIFY in Android]: https://android-developers.googleblog.com/2017/04/fortify-in-android.html
[Issue 1004]: https://github.com/android-ndk/ndk/issues/1004