Thamster 3v324v23 commited on
Commit
0025feb
·
unverified ·
1 Parent(s): cabac42

android : fix build and ci (#2624)

Browse files

* Adding missing CMakeLists.txt include for ggm-cpu needed by whisper.android

* attempt to re-enable CI for JNI android

---------

Co-authored-by: Your Name <[email protected]>

.github/workflows/build.yml CHANGED
@@ -564,35 +564,34 @@ jobs:
564
  - name: Build swiftui example
565
  run: xcodebuild -project examples/whisper.swiftui/whisper.swiftui.xcodeproj -scheme WhisperCppDemo -configuration ${{ matrix.build }} -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' build
566
 
567
- # TODO: update android build and re-enable when it works
568
- # android:
569
- # runs-on: ubuntu-latest
570
- #
571
- # steps:
572
- # - name: Clone
573
- # uses: actions/checkout@v4
574
- # with:
575
- # path: whisper
576
- #
577
- # - name: Install Java
578
- # uses: actions/setup-java@v4
579
- # with:
580
- # distribution: zulu
581
- # java-version: 21
582
- #
583
- # - name: Setup Android SDK
584
- # uses: android-actions/setup-android@v3
585
- #
586
- # - name: Build
587
- # run: |
588
- # cd whisper/examples/whisper.android
589
- # ./gradlew assembleRelease --no-daemon
590
- #
591
- # - name: Build with external ggml
592
- # run: |
593
- # export PATH_TO_GGML=$PWD/ggml
594
- # cd whisper/examples/whisper.android
595
- # ./gradlew assembleRelease --no-daemon
596
 
597
  # TODO: disable because of following fail: https://github.com/ggerganov/whisper.cpp/actions/runs/11019444420/job/30627193602
598
  # android_java:
 
564
  - name: Build swiftui example
565
  run: xcodebuild -project examples/whisper.swiftui/whisper.swiftui.xcodeproj -scheme WhisperCppDemo -configuration ${{ matrix.build }} -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' build
566
 
567
+ android:
568
+ runs-on: ubuntu-latest
569
+
570
+ steps:
571
+ - name: Clone
572
+ uses: actions/checkout@v4
573
+ with:
574
+ path: whisper
575
+
576
+ - name: Install Java
577
+ uses: actions/setup-java@v4
578
+ with:
579
+ distribution: zulu
580
+ java-version: 21
581
+
582
+ - name: Setup Android SDK
583
+ uses: android-actions/setup-android@v3
584
+
585
+ - name: Build
586
+ run: |
587
+ cd whisper/examples/whisper.android
588
+ ./gradlew assembleRelease --no-daemon
589
+
590
+ - name: Build with external ggml
591
+ run: |
592
+ export PATH_TO_GGML=$PWD/ggml
593
+ cd whisper/examples/whisper.android
594
+ ./gradlew assembleRelease --no-daemon
 
595
 
596
  # TODO: disable because of following fail: https://github.com/ggerganov/whisper.cpp/actions/runs/11019444420/job/30627193602
597
  # android_java:
examples/whisper.android/lib/src/main/jni/whisper/CMakeLists.txt CHANGED
@@ -88,3 +88,5 @@ include_directories(${WHISPER_LIB_DIR}/src)
88
  include_directories(${WHISPER_LIB_DIR}/include)
89
  include_directories(${WHISPER_LIB_DIR}/ggml/include)
90
  include_directories(${WHISPER_LIB_DIR}/ggml/src)
 
 
 
88
  include_directories(${WHISPER_LIB_DIR}/include)
89
  include_directories(${WHISPER_LIB_DIR}/ggml/include)
90
  include_directories(${WHISPER_LIB_DIR}/ggml/src)
91
+ include_directories(${WHISPER_LIB_DIR}/ggml/src/ggml-cpu)
92
+