@@ -19,6 +19,7 @@ build_android_native_library() {
19
19
ANDROID_ABI=" $1 "
20
20
ANDROID_NDK=" ${ANDROID_NDK:-/ opt/ ndk} "
21
21
CMAKE_OUT=" cmake-out-android-${ANDROID_ABI} "
22
+ EXECUTORCH_CMAKE_BUILD_TYPE=" ${EXECUTORCH_CMAKE_BUILD_TYPE:- Release} "
22
23
QNN_SDK_ROOT=" ${QNN_SDK_ROOT:- } "
23
24
if [ -n " $QNN_SDK_ROOT " ]; then
24
25
EXECUTORCH_BUILD_QNN=ON
@@ -52,15 +53,15 @@ build_android_native_library() {
52
53
-DNEURON_BUFFER_ALLOCATOR_LIB=" ${NEURON_BUFFER_ALLOCATOR_LIB} " \
53
54
-DEXECUTORCH_BUILD_QNN=" ${EXECUTORCH_BUILD_QNN} " \
54
55
-DQNN_SDK_ROOT=" ${QNN_SDK_ROOT} " \
55
- -DCMAKE_BUILD_TYPE=Release \
56
+ -DCMAKE_BUILD_TYPE=" ${EXECUTORCH_CMAKE_BUILD_TYPE} " \
56
57
-B" ${CMAKE_OUT} "
57
58
58
59
if [ " $( uname) " == " Darwin" ]; then
59
60
CMAKE_JOBS=$(( $(sysctl - n hw.ncpu) - 1 ))
60
61
else
61
62
CMAKE_JOBS=$(( $(nproc) - 1 ))
62
63
fi
63
- cmake --build " ${CMAKE_OUT} " -j " ${CMAKE_JOBS} " --target install --config Release
64
+ cmake --build " ${CMAKE_OUT} " -j " ${CMAKE_JOBS} " --target install --config " ${EXECUTORCH_CMAKE_BUILD_TYPE} "
64
65
65
66
cmake extension/android \
66
67
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK} /build/cmake/android.toolchain.cmake \
@@ -72,10 +73,10 @@ build_android_native_library() {
72
73
-DNEURON_BUFFER_ALLOCATOR_LIB=" $NEURON_BUFFER_ALLOCATOR_LIB " \
73
74
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
74
75
-DEXECUTORCH_BUILD_LLAMA_JNI=ON \
75
- -DCMAKE_BUILD_TYPE=Release \
76
+ -DCMAKE_BUILD_TYPE=" ${EXECUTORCH_CMAKE_BUILD_TYPE} " \
76
77
-B" ${CMAKE_OUT} " /extension/android
77
78
78
- cmake --build " ${CMAKE_OUT} " /extension/android -j " ${CMAKE_JOBS} " --config Release
79
+ cmake --build " ${CMAKE_OUT} " /extension/android -j " ${CMAKE_JOBS} " --config " ${EXECUTORCH_CMAKE_BUILD_TYPE} "
79
80
80
81
# Copy artifacts to ABI specific directory
81
82
mkdir -p " ${BUILD_AAR_DIR} /jni/${ANDROID_ABI} "
0 commit comments