Skip to content

Support for cmdline flag to toggle Debug vs Release build types in cmake #11662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025
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
5 changes: 3 additions & 2 deletions .ci/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ build_executorch_runner() {
}

cmake_install_executorch_lib() {
build_type="${1:-Release}"
echo "Installing libexecutorch.a and libportable_kernels.a"
clean_executorch_install_folders
retry cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=${build_type} \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-Bcmake-out .
cmake --build cmake-out -j9 --target install --config Release
cmake --build cmake-out -j9 --target install --config ${build_type}
}

download_stories_model_artifacts() {
Expand Down
11 changes: 8 additions & 3 deletions examples/selective_build/test_selective_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ test_cmake_select_ops_in_model() {
local example_dir=examples/selective_build
local build_dir=cmake-out/${example_dir}
rm -rf ${build_dir}
retry cmake -DCMAKE_BUILD_TYPE=Release \
retry cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DEXECUTORCH_SELECT_OPS_FROM_MODEL="./mv2.pte" \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-B${build_dir} \
${example_dir}

echo "Building ${example_dir}"
cmake --build ${build_dir} -j9 --config Release
cmake --build ${build_dir} -j9 --config $CMAKE_BUILD_TYPE

echo 'Running selective build test'
${build_dir}/selective_build_test --model_path="./mv2.pte"
Expand All @@ -194,9 +194,14 @@ then
PYTHON_EXECUTABLE=python3
fi

if [[ -z $CMAKE_BUILD_TYPE ]];
then
CMAKE_BUILD_TYPE=Release
fi

if [[ $1 == "cmake" ]];
then
cmake_install_executorch_lib
cmake_install_executorch_lib $CMAKE_BUILD_TYPE
test_cmake_select_all_ops
test_cmake_select_ops_in_list
test_cmake_select_ops_in_yaml
Expand Down
Loading