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.

66 lines
1.8 KiB

  1. #!/usr/bin/env bash
  2. ((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; }
  3. set -euxo pipefail
  4. conan --version # check it works
  5. cmake_args=(
  6. -S .
  7. -B build
  8. -G "${AUDACITY_CMAKE_GENERATOR}"
  9. -D use_pch=no
  10. -D CMAKE_BUILD_TYPE="${AUDACITY_BUILD_TYPE}"
  11. -D CMAKE_INSTALL_PREFIX="${AUDACITY_INSTALL_PREFIX}"
  12. )
  13. if [[ "${AUDACITY_CMAKE_GENERATOR}" == "Visual Studio"* ]]; then
  14. cmake_args+=(
  15. # skip unneeded configurations
  16. -D CMAKE_CONFIGURATION_TYPES="${AUDACITY_BUILD_TYPE}"
  17. )
  18. case "${AUDACITY_ARCH_LABEL}" in
  19. 32bit) cmake_args+=( -A Win32 ) ;;
  20. 64bit) cmake_args+=( -A x64 ) ;;
  21. *) echo >&2 "$0: Unrecognised arch label '${AUDACITY_ARCH_LABEL}'" ; exit 1 ;;
  22. esac
  23. elif [[ "${AUDACITY_CMAKE_GENERATOR}" == Xcode* ]]; then
  24. cmake_args+=(
  25. # skip unneeded configurations
  26. -D CMAKE_CONFIGURATION_TYPES="${AUDACITY_BUILD_TYPE}"
  27. -T buildsystem=1
  28. )
  29. fi
  30. if [[ -n "${APPLE_CODESIGN_IDENTITY}" && "${OSTYPE}" == darwin* ]]; then
  31. cmake_args+=(
  32. -D APPLE_CODESIGN_IDENTITY="${APPLE_CODESIGN_IDENTITY}"
  33. -D perform_codesign=yes
  34. )
  35. if [[ ${GIT_BRANCH} == release* ]]; then
  36. cmake_args+=(
  37. -D APPLE_NOTARIZATION_USER_NAME="${APPLE_NOTARIZATION_USER_NAME}"
  38. -D APPLE_NOTARIZATION_PASSWORD="${APPLE_NOTARIZATION_PASSWORD}"
  39. -D perform_notarization=yes
  40. )
  41. fi
  42. elif [[ -n "${WINDOWS_CERTIFICATE}" && "${OSTYPE}" == msys* ]]; then
  43. # Windows certificate will be used from the environment
  44. cmake_args+=(
  45. -D perform_codesign=yes
  46. )
  47. fi
  48. if [[ ${GIT_BRANCH} == release* ]]; then
  49. cmake_args+=(
  50. -D package_manual=yes
  51. )
  52. fi
  53. # Configure Audacity
  54. cmake "${cmake_args[@]}"
  55. # Remove build directories and sources to reduce the cache size.
  56. conan remove "*" --src --builds --force