@@ -19,6 +19,7 @@ build_android_native_library() {
1919 ANDROID_ABI=" $1 "
2020 ANDROID_NDK=" ${ANDROID_NDK:-/ opt/ ndk} "
2121 CMAKE_OUT=" cmake-out-android-${ANDROID_ABI} "
22+ EXECUTORCH_CMAKE_BUILD_TYPE=" ${EXECUTORCH_CMAKE_BUILD_TYPE:- Release} "
2223 QNN_SDK_ROOT=" ${QNN_SDK_ROOT:- } "
2324 if [ -n " $QNN_SDK_ROOT " ]; then
2425 EXECUTORCH_BUILD_QNN=ON
@@ -52,15 +53,15 @@ build_android_native_library() {
5253 -DNEURON_BUFFER_ALLOCATOR_LIB=" ${NEURON_BUFFER_ALLOCATOR_LIB} " \
5354 -DEXECUTORCH_BUILD_QNN=" ${EXECUTORCH_BUILD_QNN} " \
5455 -DQNN_SDK_ROOT=" ${QNN_SDK_ROOT} " \
55- -DCMAKE_BUILD_TYPE=Release \
56+ -DCMAKE_BUILD_TYPE=" ${EXECUTORCH_CMAKE_BUILD_TYPE} " \
5657 -B" ${CMAKE_OUT} "
5758
5859 if [ " $( uname) " == " Darwin" ]; then
5960 CMAKE_JOBS=$(( $(sysctl - n hw.ncpu) - 1 ))
6061 else
6162 CMAKE_JOBS=$(( $(nproc) - 1 ))
6263 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} "
6465
6566 cmake extension/android \
6667 -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK} /build/cmake/android.toolchain.cmake \
@@ -72,10 +73,10 @@ build_android_native_library() {
7273 -DNEURON_BUFFER_ALLOCATOR_LIB=" $NEURON_BUFFER_ALLOCATOR_LIB " \
7374 -DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
7475 -DEXECUTORCH_BUILD_LLAMA_JNI=ON \
75- -DCMAKE_BUILD_TYPE=Release \
76+ -DCMAKE_BUILD_TYPE=" ${EXECUTORCH_CMAKE_BUILD_TYPE} " \
7677 -B" ${CMAKE_OUT} " /extension/android
7778
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} "
7980
8081 # Copy artifacts to ABI specific directory
8182 mkdir -p " ${BUILD_AAR_DIR} /jni/${ANDROID_ABI} "
0 commit comments