You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

55 lines
1.5 KiB

  1. #!/usr/bin/env bash
  2. # Cross compile for Windows from Linux
  3. TEMP_PATH="$(pwd)/winpath"
  4. set -e
  5. # Compile and build zlib
  6. if [ -d "zlib" ]; then
  7. cd zlib && git pull
  8. else
  9. git clone https://github.com/madler/zlib && cd zlib
  10. fi
  11. mkdir -p build && cd build
  12. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH ..
  13. make -j4
  14. make install
  15. cd ../..
  16. # Clone and build ligpng
  17. if [ -d "libpng" ]; then
  18. cd libpng && git pull
  19. else
  20. git clone https://github.com/glennrp/libpng && cd libpng
  21. fi
  22. mkdir -p build && cd build
  23. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH ..
  24. make -j4
  25. make install
  26. cd ../..
  27. # Download libsndfile
  28. if [ ! -d "libsndfile-1.0.29-win64" ]; then
  29. wget https://github.com/erikd/libsndfile/releases/download/v1.0.29/libsndfile-1.0.29-win64.zip
  30. unzip libsndfile-1.0.29-win64.zip
  31. fi
  32. cp "libsndfile-1.0.29-win64/bin/sndfile.dll" $TEMP_PATH/bin/sndfile.dll
  33. cp "libsndfile-1.0.29-win64/include/sndfile.h" $TEMP_PATH/include/sndfile.h
  34. cp "libsndfile-1.0.29-win64/lib/sndfile.lib" $TEMP_PATH/lib/sndfile.lib
  35. # Copy DLL's into root for CPack
  36. cp $TEMP_PATH/bin/*.dll ../
  37. buildtype="Debug"
  38. if [[ "$1" == "Release" ]]; then
  39. buildtype="Release"
  40. fi
  41. # Build aptdec
  42. mkdir -p winbuild && cd winbuild
  43. cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH ..
  44. make -j 4
  45. make package