Skip to content

Commit

Permalink
Updating keyboard build scripts to work in Cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
haata committed Aug 1, 2016
1 parent 9309889 commit 014a428
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Keyboards/cmake.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 014a428

Please sign in to comment.