@@ -27,6 +27,7 @@ enable_link_dylib="OFF"
2727enable_static_libcpp=" "
2828enable_build_shared=" OFF"
2929skip_build=" "
30+ clean_obj=" "
3031skip_install=" "
3132skip_dist=" "
3233enable_ccache=" OFF"
@@ -103,6 +104,7 @@ function usage() {
103104 echo " -skip-build Skip building and go straight to install"
104105 echo " -skip-install Do not perform install step at end of build"
105106 echo " -skip-dist Do build a distribution package"
107+ echo " -clean-obj Remove obj directory after build is complete"
106108 echo " -with-docs Build documentation"
107109 echo " -no-docs Do not build documentation"
108110 echo " -with-examples Build examples"
@@ -205,6 +207,9 @@ while [ $# -gt 0 ]; do
205207 -skip-dist | --skip-dist)
206208 skip_dist=" true"
207209 ;;
210+ -clean-obj | --clean-obj)
211+ clean_obj=" true"
212+ ;;
208213 -with-docs | --with-docs)
209214 enable_docs=" ON"
210215 ;;
@@ -637,7 +642,11 @@ else
637642 configure_core 1 $flavor " $stage1_objdir "
638643 build_core 1 $flavor " $stage1_objdir " " $stage1_destdir "
639644 clean_RPATH " ${stage1_destdir} /usr/local"
640- ;;
645+
646+ if [ " ${clean_obj} " = " true" ]; then
647+ rm -rf " ${stage1_objdir} "
648+ fi
649+ ;;
641650 2)
642651 if [ -z " $skip_build " ]; then
643652 echo " # Stage 2: Preparing Build Enviornment"
@@ -664,6 +673,10 @@ else
664673 configure_core 2 $flavor " $stage2_objdir "
665674 build_core 2 $flavor " $stage2_objdir " " $stage2_destdir "
666675 clean_RPATH " ${stage2_destdir} /usr/local"
676+
677+ if [ " ${clean_obj} " = " true" ]; then
678+ rm -rf " ${stage2_objdir} "
679+ fi
667680 else
668681 if [ ! -d " $stage2_destdir " ]; then
669682 echo " # Unable to skip build! Previous stage 2 build doesn't exist"
0 commit comments