Update adxetools.gradle

This commit is contained in:
deal 2022-01-28 19:51:42 +08:00 committed by GitHub
parent 2bc22e1bd1
commit 8270c4f5dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 16 deletions

View File

@ -236,23 +236,10 @@ class adxetools {
static String findCMakeFromBinDir(String cmakeVer, String cmakeBin, boolean allowNewerCMake) { static String findCMakeFromBinDir(String cmakeVer, String cmakeBin, boolean allowNewerCMake) {
def foundCMakeVer = null def foundCMakeVer = null
String ninjaName = isWindows() ? "ninja.exe" : "ninja" String ninjaPath = cmakeBin + File.separator + isWindows() ? "ninja.exe" : "ninja"
String ninjaPath = cmakeBin + File.separator + ninjaName
if(!new File(ninjaPath).isFile()) { if(!new File(ninjaPath).isFile()) {
// check whether ninja in other location and in path println("The required ninja program is not present in cmake bin dir!")
def ninjaInstalled = false return null
try {
Process proc = Runtime.getRuntime().exec("ninja --version")
proc.waitFor()
int exitVal = proc.exitValue()
ninjaInstalled = exitVal == 0
} catch(Exception) {
}
if (!ninjaInstalled) {
throw new GradleException("Required $ninjaPath exists!")
}
} }
try { try {