@@ -14,6 +14,7 @@ BUILD_TOOL=$2 # buck2 or cmake
1414DTYPE=$3 # fp16, bf16, or fp32
1515MODE=${4:- " xnnpack+custom" } # portable or xnnpack+custom or xnnpack+custom+qe
1616UPLOAD_DIR=${5:- }
17+ CMAKE_BUILD_TYPE=${6:- Release}
1718if [[ $# -lt 4 ]]; then # Assuming 4 mandatory args
1819 echo " Expecting atleast 4 positional arguments"
1920 echo " Usage: [...]"
@@ -106,7 +107,7 @@ cmake_install_executorch_libraries() {
106107 rm -rf cmake-out
107108 retry cmake \
108109 -DCMAKE_INSTALL_PREFIX=cmake-out \
109- -DCMAKE_BUILD_TYPE=Debug \
110+ -DCMAKE_BUILD_TYPE=" $CMAKE_BUILD_TYPE " \
110111 -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
111112 -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
112113 -DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
@@ -120,22 +121,22 @@ cmake_install_executorch_libraries() {
120121 -DQNN_SDK_ROOT=" $QNN_SDK_ROOT " \
121122 -DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " \
122123 -Bcmake-out .
123- cmake --build cmake-out -j9 --target install --config Debug
124+ cmake --build cmake-out -j9 --target install --config " $CMAKE_BUILD_TYPE "
124125}
125126
126127cmake_build_llama_runner () {
127128 echo " Building llama runner"
128129 dir=" examples/models/llama"
129130 retry cmake \
130131 -DCMAKE_INSTALL_PREFIX=cmake-out \
131- -DCMAKE_BUILD_TYPE=Debug \
132+ -DCMAKE_BUILD_TYPE=" $CMAKE_BUILD_TYPE " \
132133 -DEXECUTORCH_BUILD_KERNELS_CUSTOM=" $CUSTOM " \
133134 -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
134135 -DEXECUTORCH_BUILD_XNNPACK=" $XNNPACK " \
135136 -DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " \
136137 -Bcmake-out/${dir} \
137138 ${dir}
138- cmake --build cmake-out/${dir} -j9 --config Debug
139+ cmake --build cmake-out/${dir} -j9 --config " $CMAKE_BUILD_TYPE "
139140
140141}
141142
0 commit comments