mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Android: Allow NDK location to be overridden
This commit is contained in:
@ -161,25 +161,33 @@ String getGitPath() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getNdkPath() {
|
String getNdkPath() {
|
||||||
try {
|
def propsFile = rootProject.file("build.properties")
|
||||||
def stdout = new ByteArrayOutputStream()
|
def ndkPath = null
|
||||||
|
if (propsFile.canRead()) {
|
||||||
exec {
|
def buildProperties = new Properties()
|
||||||
// ndk-build.cmd is a file unique to the root directory of android-ndk-r10e.
|
buildProperties.load(new FileInputStream(propsFile))
|
||||||
commandLine 'locate', 'ndk-build.cmd'
|
ndkPath = buildProperties.ndkPath
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
|
|
||||||
def ndkCmdPath = stdout.toString()
|
|
||||||
def ndkPath = ndkCmdPath.substring(0, ndkCmdPath.lastIndexOf('/'))
|
|
||||||
|
|
||||||
project.logger.quiet("Gradle: Found Android NDK:" + ndkPath)
|
|
||||||
|
|
||||||
return ndkPath
|
|
||||||
} catch (ignored) {
|
|
||||||
project.logger.error("Gradle error: Couldn't find NDK.")
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
if (ndkPath == null) {
|
||||||
|
try {
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
|
||||||
|
exec {
|
||||||
|
// ndk-build.cmd is a file unique to the root directory of android-ndk-r10e.
|
||||||
|
commandLine 'locate', 'ndk-build.cmd'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
|
||||||
|
def ndkCmdPath = stdout.toString()
|
||||||
|
ndkPath = ndkCmdPath.substring(0, ndkCmdPath.lastIndexOf('/'))
|
||||||
|
} catch (ignored) {
|
||||||
|
project.logger.error("Gradle error: Couldn't find NDK.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ndkPath != null) {
|
||||||
|
project.logger.quiet("Gradle: Found Android NDK: " + ndkPath)
|
||||||
|
}
|
||||||
|
return ndkPath
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAbi() {
|
String getAbi() {
|
||||||
|
Reference in New Issue
Block a user