comparison Keyboards/cmake.bash @ 393:4ca343d30b73

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.
author Mason Donahue <masond+github@gmail.com>
date Sun, 18 Oct 2015 14:40:18 -0500
parents 83cb0d4b57e3
children 99f93dec8fea
comparison
equal deleted inserted replaced
392:36b047a5afb0 393:4ca343d30b73
80 # Run CMake commands 80 # Run CMake commands
81 ## TODO Check for windows and do windows specific things ## 81 ## TODO Check for windows and do windows specific things ##
82 mkdir -p "${BuildPath}" 82 mkdir -p "${BuildPath}"
83 cd "${BuildPath}" 83 cd "${BuildPath}"
84 cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" 84 cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}"
85 return_code=$?
86 if [ $return_code != 0 ] ; then
87 echo "Error in cmake. Exiting..."
88 exit $return_code
89 fi
90
85 make 91 make
92 return_code=$?
93 if [ $return_code != 0 ] ; then
94 echo "Error in make. Exiting..."
95 exit $return_code
96 fi
86 97
87 echo "Firmware has been compiled into: '${BuildPath}'" 98 echo "Firmware has been compiled into: '${BuildPath}'"
88 cd - 99 cd -
89 100