From 014a42829b91f691e51a2f9b2b46c1918d1cf0b6 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Sun, 31 Jul 2016 20:41:00 -0700 Subject: [PATCH] Updating keyboard build scripts to work in Cygwin See wiki for setup details -> https://github.com/kiibohd/controller/wiki/Windows-Setup --- Keyboards/cmake.bash | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Keyboards/cmake.bash b/Keyboards/cmake.bash index 69c76cf..b4ea5f1 100644 --- a/Keyboards/cmake.bash +++ b/Keyboards/cmake.bash @@ -84,11 +84,25 @@ done # Run CMake commands -## TODO Check for windows and do windows specific things ## 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=$? + +# Cygwin +if [[ $(uname -s) == MINGW32_NT* ]] || [[ $(uname -s) == CYGWIN* ]]; then + if [[ -z "$wincmake_path" ]]; then + echo "Error wincmake_path environment variable has not been set, see -> https://github.com/kiibohd/controller/wiki/Windows-Setup" + exit 1 + fi + PATH="$wincmake_path":"${PATH}" cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" -G 'Unix Makefiles' + return_code=$? + +# Linux / Mac (and everything else) +else + cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" + return_code=$? + +fi + if [ $return_code != 0 ] ; then echo "Error in cmake. Exiting..." exit $return_code