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.

74 lines
1.7KB

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