# HG changeset patch # User Mason Donahue # Date 1445197218 18000 # Node ID 4ca343d30b739f3e4d8d6c3739ab4e21a677097f # Parent 36b047a5afb0582e2637a3883fda32569901244b 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. diff -r 36b047a5afb0 -r 4ca343d30b73 Keyboards/cmake.bash --- a/Keyboards/cmake.bash Sat Oct 17 21:03:07 2015 -0700 +++ b/Keyboards/cmake.bash Sun Oct 18 14:40:18 2015 -0500 @@ -82,7 +82,18 @@ mkdir -p "${BuildPath}" cd "${BuildPath}" 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 +return_code=$? +if [ $return_code != 0 ] ; then + echo "Error in make. Exiting..." + exit $return_code +fi echo "Firmware has been compiled into: '${BuildPath}'" cd -