Selaa lähdekoodia

Exit quickly when cmake or make fail

The compilation process itself doesn't take very long, but it's weird to
let it continue trying to build when we've encountered an error worthy
of changing cmake/make's return codes. This gives clear indication of a
failed build as the last line of the script's output.
capsense
Mason Donahue 8 vuotta sitten
vanhempi
commit
c48eece590
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. 11
    0
      Keyboards/cmake.bash

+ 11
- 0
Keyboards/cmake.bash Näytä tiedosto

mkdir -p "${BuildPath}" mkdir -p "${BuildPath}"
cd "${BuildPath}" cd "${BuildPath}"
cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}"
return_code=$?
if [ $return_code != 0 ] ; then
echo "Error in cmake. Exiting..."
exit $return_code
fi

make make
return_code=$?
if [ $return_code != 0 ] ; then
echo "Error in make. Exiting..."
exit $return_code
fi


echo "Firmware has been compiled into: '${BuildPath}'" echo "Firmware has been compiled into: '${BuildPath}'"
cd - cd -