build_AWSNativeSDK_mac.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. src_path=temp/src
  9. bld_path=temp/build
  10. inst_path=temp/install
  11. echo "Command: rm -rf $inst_path"
  12. rm -rf $inst_path || (echo "Command: rm -rf $inst_path failed" ; exit 1)
  13. configure_and_build() {
  14. build_type=$1
  15. lib_type=$2
  16. build_shared=OFF
  17. if [ "$lib_type" == "Shared" ]
  18. then
  19. build_shared=ON
  20. fi
  21. echo "CMake Configure $build_type $lib_type"
  22. CFLAGS="-Wno-deprecated-declarations -Wno-shorten-64-to-32 -fPIC" CXXFLAGS="-Wno-deprecated-declarations -Wno-shorten-64-to-32 -fPIC" cmake -S "$src_path" -B "$bld_path/${build_type}_${lib_type}" \
  23. -G "Xcode" \
  24. -DTARGET_ARCH=APPLE \
  25. -DCMAKE_OSX_ARCHITECTURES="x86_64" \
  26. -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \
  27. -DCMAKE_CXX_STANDARD=17 \
  28. -DCPP_STANDARD=17 \
  29. -DENABLE_TESTING=OFF \
  30. -DENABLE_RTTI=ON \
  31. -DCUSTOM_MEMORY_MANAGEMENT=ON \
  32. -DBUILD_ONLY="access-management;bedrock-runtime;cognito-identity;cognito-idp;core;devicefarm;dynamodb;gamelift;identity-management;kinesis;lambda;queues;s3;sns;sqs;sts;transfer" \
  33. -DBUILD_SHARED_LIBS=$build_shared \
  34. -DCMAKE_BUILD_TYPE=$build_type \
  35. -DCMAKE_INSTALL_BINDIR="bin" \
  36. -DCMAKE_INSTALL_LIBDIR="lib" || (echo "CMake Configure $build_type $lib_type failed" ; exit 1)
  37. echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type}"
  38. cmake --build "$bld_path/${build_type}_${lib_type}" --config $build_type -j 12 || (echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type} failed" ; exit 1)
  39. }
  40. # Debug Shared
  41. configure_and_build Debug Shared || exit 1
  42. # Debug Static
  43. configure_and_build Debug Static || exit 1
  44. # Release Shared
  45. configure_and_build Release Shared || exit 1
  46. # Release Static
  47. configure_and_build Release Static || exit 1
  48. echo "Custom Build for AWSNativeSDK finished successfully"
  49. exit 0