build-godot-macosx.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. set -e
  3. if [ -z $1 ]; then
  4. echo "Usage: $0 <mono version"
  5. exit 1
  6. fi
  7. MONO_VERSION=$1
  8. export BUILD_NAME=official
  9. export OPTIONS="builtin_libpng=yes builtin_openssl=yes builtin_zlib=yes gdnative_wrapper=yes debug_symbols=no"
  10. export SCONS="scons -j8 verbose=no warnings=no progress=no"
  11. export MONO32_PREFIX=/Library/Frameworks/Mono.framework/Versions/$(echo ${MONO_VERSION} | cut -d. -f 1,2,3)/
  12. export MONO64_PREFIX=/Library/Frameworks/Mono.framework/Versions/$(echo ${MONO_VERSION} | cut -d. -f 1,2,3)/
  13. export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
  14. brew update
  15. brew install scons
  16. rm -rf godot
  17. git clone https://github.com/godotengine/godot.git
  18. cd godot
  19. git config --global user.email "you@example.com"
  20. git config --global user.name "Your Name"
  21. git checkout -b 3.0 origin/3.0 || git checkout 3.0
  22. git branch --set-upstream-to=origin/3.0 3.0
  23. git reset --hard
  24. git pull
  25. cp ../mono-glue/* modules/mono/glue
  26. $SCONS platform=osx bits=fat $OPTIONS tools=yes target=release_debug use_static_cpp=yes
  27. $SCONS platform=osx bits=fat $OPTIONS tools=no target=release_debug use_static_cpp=yes
  28. $SCONS platform=osx bits=fat $OPTIONS tools=no target=release use_static_cpp=yes
  29. $SCONS platform=osx bits=fat $OPTIONS tools=yes target=release_debug use_static_cpp=yes module_mono_enabled=yes mono_static=yes
  30. $SCONS platform=osx bits=fat $OPTIONS tools=no target=release_debug use_static_cpp=yes module_mono_enabled=yes mono_static=yes
  31. $SCONS platform=osx bits=fat $OPTIONS tools=no target=release use_static_cpp=yes module_mono_enabled=yes mono_static=yes
  32. $SCONS platform=iphone arch=arm $OPTIONS tools=no target=release_debug
  33. $SCONS platform=iphone arch=arm $OPTIONS tools=no target=release
  34. $SCONS platform=iphone arch=arm64 $OPTIONS tools=no target=release_debug
  35. $SCONS platform=iphone arch=arm64 $OPTIONS tools=no target=release
  36. $SCONS platform=iphone arch=x86 $OPTIONS tools=no target=release_debug
  37. $SCONS platform=iphone arch=x86 $OPTIONS tools=no target=release
  38. lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a bin/libgodot.iphone.opt.x86.a -output bin/libgodot.iphone.opt.fat
  39. lipo -create bin/libgodot.iphone.opt.debug.arm.a bin/libgodot.iphone.opt.debug.arm64.a bin/libgodot.iphone.opt.debug.x86.a -output bin/libgodot.iphone.opt.debug.fat