build_mingw32.sh 652 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. # Accomodate both linux windows mingw locations
  3. MINGW=/mingw32
  4. if [ -z "$MSYSCON" ]; then
  5. MINGW=/opt$MINGW
  6. else
  7. CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1"
  8. fi
  9. export PATH=$MINGW/bin:$PATH
  10. export CFLAGS="-march=pentium3 -mtune=generic -mpreferred-stack-boundary=5 -mfpmath=sse"
  11. export CXXFLAGS="$CFLAGS"
  12. if [ "$1" = "-qt5" ]; then
  13. QT5=True
  14. fi
  15. if [ $QT5 ]; then
  16. CMAKE_OPTS="-DWANT_QT5=$QT5 -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
  17. fi
  18. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  19. cmake $DIR/.. -DCMAKE_TOOLCHAIN_FILE=$DIR/../cmake/modules/Win32Toolchain.cmake -DCMAKE_MODULE_PATH=$DIR/../cmake/modules/ $CMAKE_OPTS