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.

73 lines
1.7KB

  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. "CYGWIN"*|"MSYS"*)
  38. WIN32=1
  39. if [ "$(uname -m)" = "x86_64" ]; then
  40. WIN64=1
  41. fi
  42. ;;
  43. "linux"|"Linux")
  44. LINUX=1
  45. ;;
  46. "native")
  47. target=$(uname -s)
  48. check_target
  49. if [ "${target}" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
  50. MACOS_UNIVERSAL=1
  51. fi
  52. ;;
  53. default)
  54. echo "Invalid target '${target}', possible values are:"
  55. echo "\tmacos"
  56. echo "\tmacos-old"
  57. echo "\tmacos-universal"
  58. echo "\twin32"
  59. echo "\twin64"
  60. echo "\tnative"
  61. if [ -z "${VALIDATE_TARGET}" ]; then
  62. exit 2
  63. else
  64. INVALID_TARGET=1
  65. fi
  66. ;;
  67. esac
  68. }
  69. check_target