Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/whisper.android.java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ android {
}

buildTypes {
debug {
externalNativeBuild {
cmake {
// When the AGP build type is Debug, the native (NDK/CMake) build does not run
// compiler optimizations by default, causing a critical performance issue.
// We force CMAKE_BUILD_TYPE to Release here so native code stays optimized
// even in Debug AGP builds.
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
}

release {
signingConfig signingConfigs.debug
minifyEnabled true
Expand Down
13 changes: 13 additions & 0 deletions examples/whisper.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,25 @@ android {
}

buildTypes {
debug {
externalNativeBuild {
cmake {
// When the AGP build type is Debug, the native (NDK/CMake) build does not run
// compiler optimizations by default, causing a critical performance issue.
// We force CMAKE_BUILD_TYPE to Release here so native code stays optimized
// even in Debug AGP builds.
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
}

release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
Expand Down
Loading