Cross-Platform build scripts for audio plugins
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.

67 lines
1.5KB

  1. #!/bin/bash
  2. CROSS_COMPILING=0
  3. LINUX=0
  4. MACOS=0
  5. MACOS_OLD=0
  6. MACOS_UNIVERSAL=0
  7. WIN32=0
  8. WIN64=0
  9. function check_target() {
  10. case "${target}" in
  11. "macos"|"Darwin")
  12. MACOS=1
  13. ;;
  14. "macos-old")
  15. MACOS=1
  16. MACOS_OLD=1
  17. CROSS_COMPILING=1
  18. ;;
  19. "macos-universal")
  20. MACOS=1
  21. MACOS_UNIVERSAL=1
  22. ;;
  23. "win32"|"MINGW32*")
  24. WIN32=1
  25. CROSS_COMPILING=1
  26. if [ "$(uname -o)" != "Msys" ] && [ "$(uname -o)" != "Cygwin" ]; then
  27. CROSS_COMPILING=1
  28. fi
  29. ;;
  30. "win64"|"MINGW64*")
  31. WIN32=1
  32. WIN64=1
  33. if [ "$(uname -o)" != "Msys" ] && [ "$(uname -o)" != "Cygwin" ]; then
  34. CROSS_COMPILING=1
  35. fi
  36. ;;
  37. "linux"|"Linux")
  38. LINUX=1
  39. ;;
  40. "native")
  41. target=$(uname -s)
  42. check_target
  43. if [ "${target}" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
  44. MACOS_UNIVERSAL=1
  45. fi
  46. ;;
  47. default)
  48. echo "Invalid target '${target}', possible values are:"
  49. echo "\tmacos"
  50. echo "\tmacos-old"
  51. echo "\tmacos-universal"
  52. echo "\twin32"
  53. echo "\twin64"
  54. echo "\tnative"
  55. if [ -z "${VALIDATE_TARGET}" ]; then
  56. exit 2
  57. else
  58. INVALID_TARGET=1
  59. fi
  60. ;;
  61. esac
  62. }
  63. check_target