2
0

prepare_solution_darwin.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. BUILD_DIR='build'
  10. mkdir $BUILD_DIR
  11. CMAKE='cmake'
  12. if ! command -v $CMAKE &> /dev/null
  13. then
  14. OLDCMAKE=$CMAKE
  15. CMAKE='-/Applications/CMake.app/Contents/bin/cmake'
  16. echo "$OLDCMAKE not found in PATH. Defaulting to: $CMAKE"
  17. fi
  18. $CMAKE -G "Xcode" -S "src/" -B $BUILD_DIR
  19. echo "Xcode project created successfully."
  20. echo "Will proceed to build in Release configuration..."
  21. $CMAKE --build $BUILD_DIR --target azslc --config Release -j 16
  22. pushd $BUILD_DIR/Release
  23. echo "Release version:"
  24. ./azslc --version
  25. popd
  26. echo "Will proceed to build in Debug configuration..."
  27. $CMAKE --build $BUILD_DIR --target azslc --config Debug -j 16
  28. pushd $BUILD_DIR/Debug
  29. echo "Debug version:"
  30. ./azslc --version
  31. popd
  32. ## Deploy
  33. echo "Deploying Release and Debug binaries..."
  34. mkdir bin
  35. mkdir bin/darwin
  36. mkdir bin/darwin/release
  37. mkdir bin/darwin/debug
  38. cp $BUILD_DIR/Release/azslc bin/darwin/release/azslc
  39. cp $BUILD_DIR/Debug/azslc bin/darwin/debug/azslc
  40. echo "Done!"