forked from joejulian/gio
cmd/gogio: [Android] check $ANDROID_NDK_ROOT
If the Android NDK is not found in a standard location (e.g. you are on an F-Droid build server), check the $ANDROID_NDK_ROOT environment variable. Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
This commit is contained in:
committed by
Elias Naur
parent
b664d68a7c
commit
3a542cc80c
@@ -591,7 +591,15 @@ func findNDK(androidHome string) (string, error) {
|
||||
if _, err := os.Stat(ndkBundle); err == nil {
|
||||
return ndkBundle, nil
|
||||
}
|
||||
return "", fmt.Errorf("no NDK found in $ANDROID_HOME (%s). Use `sdkmanager ndk-bundle` to install it", androidHome)
|
||||
// Certain non-standard NDK isntallations set the $ANDROID_NDK_ROOT
|
||||
// environment variable
|
||||
if ndkBundle, ok := os.LookupEnv("ANDROID_NDK_ROOT"); ok {
|
||||
if _, err := os.Stat(ndkBundle); err == nil {
|
||||
return ndkBundle, nil
|
||||
}
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("no NDK found in $ANDROID_HOME (%s). Set $ANDROID_NDK_ROOT or use `sdkmanager ndk-bundle` to install the NDK", androidHome)
|
||||
}
|
||||
|
||||
func findKeytool() (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user