@@ -27,6 +27,7 @@ enable_link_dylib="OFF"
27
27
enable_static_libcpp=" "
28
28
enable_build_shared=" OFF"
29
29
skip_build=" "
30
+ clean_obj=" "
30
31
skip_install=" "
31
32
skip_dist=" "
32
33
enable_ccache=" OFF"
@@ -103,6 +104,7 @@ function usage() {
103
104
echo " -skip-build Skip building and go straight to install"
104
105
echo " -skip-install Do not perform install step at end of build"
105
106
echo " -skip-dist Do build a distribution package"
107
+ echo " -clean-obj Remove obj directory after build is complete"
106
108
echo " -with-docs Build documentation"
107
109
echo " -no-docs Do not build documentation"
108
110
echo " -with-examples Build examples"
@@ -205,6 +207,9 @@ while [ $# -gt 0 ]; do
205
207
-skip-dist | --skip-dist)
206
208
skip_dist=" true"
207
209
;;
210
+ -clean-obj | --clean-obj)
211
+ clean_obj=" true"
212
+ ;;
208
213
-with-docs | --with-docs)
209
214
enable_docs=" ON"
210
215
;;
@@ -637,7 +642,11 @@ else
637
642
configure_core 1 $flavor " $stage1_objdir "
638
643
build_core 1 $flavor " $stage1_objdir " " $stage1_destdir "
639
644
clean_RPATH " ${stage1_destdir} /usr/local"
640
- ;;
645
+
646
+ if [ " ${clean_obj} " = " true" ]; then
647
+ rm -rf " ${stage1_objdir} "
648
+ fi
649
+ ;;
641
650
2)
642
651
if [ -z " $skip_build " ]; then
643
652
echo " # Stage 2: Preparing Build Enviornment"
@@ -664,6 +673,10 @@ else
664
673
configure_core 2 $flavor " $stage2_objdir "
665
674
build_core 2 $flavor " $stage2_objdir " " $stage2_destdir "
666
675
clean_RPATH " ${stage2_destdir} /usr/local"
676
+
677
+ if [ " ${clean_obj} " = " true" ]; then
678
+ rm -rf " ${stage2_objdir} "
679
+ fi
667
680
else
668
681
if [ ! -d " $stage2_destdir " ]; then
669
682
echo " # Unable to skip build! Previous stage 2 build doesn't exist"
0 commit comments