prepare_solution_darwin.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. # Build
  9. mkdir build
  10. mkdir build/release
  11. mkdir build/debug
  12. mkdir build/release/external
  13. mkdir build/release/external/antlr-runtime-cpp
  14. mkdir build/debug/external
  15. mkdir build/debug/external/antlr-runtime-cpp
  16. CMAKE='cmake'
  17. if ! command -v $CMAKE &> /dev/null
  18. then
  19. OLDCMAKE=$CMAKE
  20. CMAKE='-/Applications/CMake.app/Contents/bin/cmake'
  21. echo "$OLDCMAKE not found in PATH. Defaulting to: $CMAKE"
  22. fi
  23. echo "Pulling ANTLR from git..."
  24. python pull_from_git.py --git-url https://github.com/galibzon/antlr4.git --destination-dir src/external --git-tag o3de-4.7.1
  25. $CMAKE -DMAKE_BUILD_TYPE=Release -S "src/external/antlr4/runtime/Cpp/" -B "build/release/external/antlr4/runtime/Cpp/"
  26. pushd build/release/external/antlr4/runtime/Cpp
  27. make -j16
  28. popd
  29. $CMAKE -DMAKE_BUILD_TYPE=Release -S "src/" -B "build/release"
  30. pushd build/release
  31. echo "Building release..."
  32. make -j16
  33. ls
  34. echo "Release version:"
  35. ./azslc --version
  36. popd
  37. $CMAKE -DMAKE_BUILD_TYPE=Debug -S "src/external/antlr4/runtime/Cpp/" -B "build/debug/external/antlr4/runtime/Cpp/"
  38. pushd build/debug/external/antlr4/runtime/Cpp
  39. make -j16
  40. popd
  41. $CMAKE -DMAKE_BUILD_TYPE=Debug -S "src/" -B "build/debug"
  42. pushd build/debug
  43. echo "Building debug..."
  44. make -j16
  45. ls
  46. echo "Debug version:"
  47. ./azslc --version
  48. popd
  49. # Deploy
  50. mkdir bin
  51. mkdir bin/darwin
  52. mkdir bin/darwin/release
  53. mkdir bin/darwin/debug
  54. cp build/release/azslc bin/darwin/release/azslc
  55. cp build/debug/azslc bin/darwin/debug/azslc