Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

build_windows.sh 1.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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