Add debug / release clear for allowing gdbserver debugging in tools configbuild script.
@@ -190,6 +190,25 @@ sub_build() {
fi
}
+sub_clear() {
+ if [ "$BUILD_TYPE" = 'Debug' ]; then
+ # Install debug packages
+ apt-get install -y gdb gdbserver --no-install-recommends --no-install-suggests
+
+ # No not delete MetaCall path (TODO: install global.json with CMake)
+ cd $METACALL_PATH \
+ && mkdir -p $METACALL_PATH/configurations \
+ && mv $CONFIGURATION_PATH $METACALL_PATH/configurations
+ elif [ "$BUILD_TYPE" = 'Release' ]; then
+ # Delete MetaCall path except from configuration file (TODO: install global.json with CMake)
+ cd $METACALL_PATH \
+ && mv $CONFIGURATION_PATH /tmp/global.json \
+ && rm -rf $METACALL_PATH \
+ && mkdir -p $METACALL_PATH/configurations \
+ && mv /tmp/global.json $METACALL_PATH/configurations
+ fi
+}
+
sub_help() {
echo "Usage: $PROGNAME list of options"
echo "Options:"
@@ -216,5 +235,6 @@ case "$#" in
*)
sub_config $@
sub_build
+ sub_clear
;;
esac
