Loading sdk/run.sh +4 −8 Original line number Diff line number Diff line Loading @@ -2,11 +2,10 @@ set -euo pipefail outfile="miphoto-exec" usage=$(echo -e "Usage: run.sh [OPTIONS] \n\t-b\tbuild \n\t-r\tcopy to camera and run \n\t-d DIR\tdirectory with .cpp and .h files") usage=$(echo -e "Usage: run.sh [OPTIONS] \n\t-b\tbuild \n\t-r\tcopy to camera and run") build=false run=false dir="." if [ $# -eq 0 ]; then echo "$usage" Loading @@ -14,14 +13,12 @@ if [ $# -eq 0 ]; then fi while getopts "brd:" opt; do while getopts "br" opt; do case ${opt} in b ) build=true ;; r ) run=true ;; d ) dir="$OPTARG" ;; \? ) echo "$usage"; exit 1; ;; esac Loading @@ -32,11 +29,10 @@ done if [ "$build" = true ] ; then sources=$(ls "$dir/"*.cpp 2>/dev/null) || (echo "No .cpp files found" && exit 1) headers=$(ls "$dir/"*.h 2>/dev/null) || true sources=$(ls *.cpp 2>/dev/null | tr '\r\n' ' ') || (echo "No .cpp files found" && exit 1) sudo docker build -t mi_camera_sdk . sudo docker run -it --rm -v "$PWD":/workdir mi_camera_sdk bash -c "arm-linux-gnueabihf-c++ -o /workdir/$outfile $sources" sudo docker run -it --rm -v "$PWD":/workdir mi_camera_sdk bash -c "arm-linux-gnueabihf-c++ -std=c++11 -o /workdir/$outfile $sources" echo -e "\n" fi Loading Loading
sdk/run.sh +4 −8 Original line number Diff line number Diff line Loading @@ -2,11 +2,10 @@ set -euo pipefail outfile="miphoto-exec" usage=$(echo -e "Usage: run.sh [OPTIONS] \n\t-b\tbuild \n\t-r\tcopy to camera and run \n\t-d DIR\tdirectory with .cpp and .h files") usage=$(echo -e "Usage: run.sh [OPTIONS] \n\t-b\tbuild \n\t-r\tcopy to camera and run") build=false run=false dir="." if [ $# -eq 0 ]; then echo "$usage" Loading @@ -14,14 +13,12 @@ if [ $# -eq 0 ]; then fi while getopts "brd:" opt; do while getopts "br" opt; do case ${opt} in b ) build=true ;; r ) run=true ;; d ) dir="$OPTARG" ;; \? ) echo "$usage"; exit 1; ;; esac Loading @@ -32,11 +29,10 @@ done if [ "$build" = true ] ; then sources=$(ls "$dir/"*.cpp 2>/dev/null) || (echo "No .cpp files found" && exit 1) headers=$(ls "$dir/"*.h 2>/dev/null) || true sources=$(ls *.cpp 2>/dev/null | tr '\r\n' ' ') || (echo "No .cpp files found" && exit 1) sudo docker build -t mi_camera_sdk . sudo docker run -it --rm -v "$PWD":/workdir mi_camera_sdk bash -c "arm-linux-gnueabihf-c++ -o /workdir/$outfile $sources" sudo docker run -it --rm -v "$PWD":/workdir mi_camera_sdk bash -c "arm-linux-gnueabihf-c++ -std=c++11 -o /workdir/$outfile $sources" echo -e "\n" fi Loading