If multiple Xcode versions are installed,
run: sudo xcode-select -s <YOUR_XCODE13_APP>/Contents/Developer
example: sudo xcode-select -s /Applications/Xcode13.app/Contents/Developer
Run: ./build.sh
If needed the ‘-e’ flag can be used to compile with OpenSSL engine support although this may cause some ‘undefined symbols for architecture’ depending on your OS version.
Developer Command Prompt for VS 2019: Available as part of Visual Studio 2019. Note: all Android build commands should be executed from this console. Usually located at "C:\Program Files (x86)\Microsoft Visual Studio019\Professional\Common7\Tools\VsDevCmd.bat"
For Ninja build tool, you may need to use the dev command prompt from VS Build Tools instead of VS Community edition, if you do not have VS Professional installed. This is especially important when using an EC2 instance instead of your local machine.
You can launch the dev cmd prompt using the LaunchDevCmd.bat in the above path.
Android NDK with Unity: (API Level 24, NDK version 21), you can use the NDK supplied by Unity. To do this, set the following (replace with the Unity version you are using):
set ndkroot=C:\Program Files\Unity\Hub\Editor\<UNITY VERSION>\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
After following the steps to install Android Studio 4.0 and downloaded the NDK using Unreal´s script, open Android Studio again and make the following modifications:
Install Android SDK Build Tools 30.0.3 in Configure > Appeareance and Behavior > System Settings > Android SDK > SDK Tools. You might need to uncheck “Hide obsolete packages”
This may also be accessed from the startup screen: Configure → SDK Manager → SDK Tools
You may need to check Show Package Details to see all the versions of the Android SDK Build Tools
Uninstall newer versions of the SDK Build Tools
AWS SDK C++
Build and Install AWS SDK C++
Note: BUILD_TYPE is either Debug or Release
Note: Make sure your development path is absolute, not relative, the install might silently fail otherwise.
Windows
Clone the AWS SDK C++: git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp (make sure you’re on tag 1.9.162 or later)
Clone the AWS SDK C++: git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp inside ~/<YOUR_DEVELOPMENT_PATH> (make sure you’re on tag 1.9.188 for macOS)
Make sure to use the same tag for aws-sdk-cpp for all builds (macOS and iOS)
For both macOS and iOS, you will need to pull in the tag v0.17.13 for crt/aws-crt-cpp submodule of aws-sdk-cpp. This fixes a bug for iOS builds related to SetKeychainPath. Make sure to init and recursive update further submodules of aws-crt-cpp.
For macOS SHARED LIBRARIES
Create a build directory called AWSSDK_mac e.g., ~/development/AWSSDK_mac
Before building Release after you have built Debug, make sure to delete all CMakeCache files and also the folder external-build in AWSSDK_android root path.
yaml-cpp
AWS GameKit uses a fixed version of yaml-cpp: commit 2f899756
Create a directory to contain the Google test repo (example: D:\development), navigate into it and clone: git clone https://github.com/google/googletest. You should end up having a directory tree like D:\development\googletest.
Navigate into the googletest directory inside newly cloned googletest repo, your cwd should look like D:\development\googletest\googletest.
Run CMake to generate the configuration files: cmake -DBUILD_SHARED_LIBS=ON -Dgtest_force_shared_crt=ON -DCMAKE_INSTALL_PREFIX=<path to gtest repo>\build\install -DGTEST_CREATE_SHARED_LIBRARY=1 ..
Build with "C:\Program Files (x86)\Microsoft Visual Studio019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=Debug -maxcpucount
Make sure it’s in a separate folder from the boost folder for win64 and macos, for example: ~/development/ios-boost.
May need to give r+w permissions to all files in this folder with chmod.
Update boost version in to 1.76.0 (or whichever one we are currently using for win64 and macos).
Change BOOST_LIBS to BOOST_LIBS="regex filesystem iostreams"
Run the script using ./boost.sh -ios.
Note: You can continue to use the other boost folder (ex: <BOOST_PARENT_DIR>\boost_1_76_0) when asked for the boost path in the scripts/aws_gamekit_cpp_build.py build script since the build needs boost source/includes. Use the ios-boost directory when prompted for the boost path in the scripts/refresh_plugin.py script that copies ios static libs.
Android Build and Install
Set these environment variables inside a Developer Command Prompt for VS 2019.
set ANDROID_API_LEVEL=24
set BUILD_TYPE=Debug
set ARCH=arm
set PLATFORM=android
set CLANGPATH=%NDKROOT%\toolchains\llvm\prebuilt\windows-x86_64\bin
set PATH=%PATH%;%CLANGPATH%
For Unreal, set:
set STL_TYPE=c++_static
For Unity, set:
set STL_TYPE=c++_shared
Copy the scripts\Android\sample-android-user-config.jam to your User directory with the name user-config.jam e.g. C:\users\<your username>\user-config.jam.
Note: Remember to remove or rename this file after building Boost for Android, otherwise all future Boost builds will use this configuration.
The script will first search your environment variables for dependency path variables. If they are not present there, it will search in
the .env file at the root of this repository (created by running this script), else it will prompt you for input on where the dependencies
are located and save those locations in the .env file.
Run Unit Tests
Windows
cd into tests\<BUILD_TYPE> directory
Run aws-gamekit-cpp-tests.exe
macOS
cd into the tests/Debug directory
Run ./aws-gamekit-cpp-tests
Update Plugin with new binaries and headers
Use the scripts/refresh_plugin.py script to update your game engine plugin with the new libraries and header files.
Example: python scripts/refresh_plugin.py --platform Windows Debug Unreal --unreal_plugin_path D:\development\MyUnrealGame\Plugins\AwsGameKit
Example: python scripts/refresh_plugin.py --platform Windows Debug Unity --unity_plugin_path D:\development\MyUnityGame\Packages\com.amazonaws.gamekit
Use --help with the script to see argument options, and using --help after supplying a GameEngine argument, it will list and explain game engine specific arguments.
If refreshing MacOS or iOS binaries you will have to codesign them to distribute them to other developers, supply the --certificate_name argument and give a Developer ID Application certificate common name.
AWS GameKit C++ SDK
Prerequisites
Download and Install CMake v3.21 Some versions of aws-sdk-cpp have a known issue compiling with CMake 3.22 or later.
Enable Windows long path support
For the build steps of the dependencies and the SDK to work properly on Windows, you will have to enable long path support.
Run the following command in an Administrator level Powershell terminal:
Dependencies
Install the dependencies in the following order:
Third party Tools for iOS Builds
iOS Toolchain file: Get the toolchain file from https://github.com/leetal/ios-cmake.
cURL, OpenSSL, nghttp: Get the script that will build cURL, OpenSSL, and nghttp for iOS from: https://github.com/jasonacox/Build-OpenSSL-cURL
sudo xcode-select -s <YOUR_XCODE13_APP>/Contents/Developerexample:sudo xcode-select -s /Applications/Xcode13.app/Contents/Developer./build.shBoost: Get the shell script that will download, bootstrap, and build Boost for iOS from: https://github.com/faithfracture/Apple-Boost-BuildScript/blob/master/boost.sh.
Third party Tools for Android Builds (On Windows)
Ninja: Available as part of Visual Studio 2019
Developer Command Prompt for VS 2019: Available as part of Visual Studio 2019. Note: all Android build commands should be executed from this console. Usually located at
"C:\Program Files (x86)\Microsoft Visual Studio019\Professional\Common7\Tools\VsDevCmd.bat"LaunchDevCmd.batin the above path.Android NDK r21d for Unreal: Use Unreal’s NDK, follow these steps to install: https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/Setup/AndroidStudio/
Android NDK with Unity: (API Level 24, NDK version 21), you can use the NDK supplied by Unity. To do this, set the following (replace with the Unity version you are using):
Android Studio Version 4: Follow these steps to install: https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/Setup/AndroidStudio/
After following the steps to install Android Studio 4.0 and downloaded the NDK using Unreal´s script, open Android Studio again and make the following modifications:
Show Package Detailsto see all the versions of theAndroid SDK Build ToolsAWS SDK C++
Build and Install AWS SDK C++
Note:
BUILD_TYPEis eitherDebugorReleaseNote: Make sure your development path is absolute, not relative, the install might silently fail otherwise.Windows
Clone the AWS SDK C++:
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp(make sure you’re on tag 1.9.162 or later)Install CMake 3.21: https://github.com/Kitware/CMake/releases/tag/v3.21.6
Use the Windows Command Prompt (or the Legacy command prompt in Windows Terminal) for the following:
Create a build directory called AWSSDK in a separate directory than where you cloned the SDK.
Change directory into AWSSDK:
Generate the SDK Project files (~5 min):
Build the SDK (~10 min depends on your workstation specs):
Install the SDK to the \AWSSDK\install location
macOS
git clone --recurse-submodules https://github.com/aws/aws-sdk-cppinside~/<YOUR_DEVELOPMENT_PATH>(make sure you’re on tag 1.9.188 for macOS)aws-sdk-cppfor all builds (macOS and iOS)v0.17.13forcrt/aws-crt-cppsubmodule ofaws-sdk-cpp. This fixes a bug for iOS builds related toSetKeychainPath. Make sure toinitand recursiveupdatefurther submodules ofaws-crt-cpp.For macOS SHARED LIBRARIES
Create a build directory called AWSSDK_mac e.g.,
~/development/AWSSDK_macChange directory into AWSSDK_mac:
Run CMake
Build and install
For iOS Static Libraries
Create a build directory called AWSSDK_ios e.g.,
~/development/AWSSDK_iosChange directory into AWSSDK_ios:
Run CMake Use XCode 12 to compile for iOS 14.0 which is the highest version supported by Unreal 4.27.
Run:
sudo xcode-select -s <YOUR_XCODE12_APP>/Contents/DeveloperExample:sudo xcode-select -s /Applications/Xcode12.app/Contents/DeveloperBuild and install
For Android Libraries
Set these environment variables inside a Developer Command Prompt for VS 2019.
Create a build directory called AWSSDK_android
Change directory into AWSSDK_android:
Run CMake
Build and install
Before building
Releaseafter you have builtDebug, make sure to delete allCMakeCachefiles and also the folderexternal-buildinAWSSDK_androidroot path.yaml-cpp
AWS GameKit uses a fixed version of yaml-cpp: commit
2f899756Windows Build and Install
git clone https://github.com/jbeder/yaml-cpp/cd yaml-cppgit checkout -b gamekit_fixed_version 2f899756mkdir buildcd buildcmake -DYAML_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<DIRECTORY_IN_STEP_TWO>\install\<BUILD_TYPE> .."C:\Program Files (x86)\Microsoft Visual Studio019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=<BUILD_TYPE> -maxcpucountmacOS Build and Install
git clone https://github.com/jbeder/yaml-cpp/cd yaml-cppgit checkout -b gamekit_fixed_version 2f899756mkdir build_maccd build_maccmake -G Xcode -DYAML_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=install/x86_64/<BUILD_TYPE> ..xcodebuild -parallelizeTargets -configuration <BUILD_TYPE> -target ALL_BUILDxcodebuild -parallelizeTargets -target installiOS Build and Install
git clone https://github.com/jbeder/yaml-cpp/(if not already cloned formacos)cd yaml-cppgit checkout -b gamekit_fixed_version 2f899756mkdir build_ios(same level asmacos)cd build_ioscmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=<YOUR_DEVELOPMENT_PATH>/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DCMAKE_BUILD_TYPE=<BUILD_TYPE> -DCMAKE_INSTALL_PREFIX=install/arm64/<BUILD_TYPE> ..xcodebuild -parallelizeTargets -configuration <BUILD_TYPE> -target ALL_BUILDxcodebuild -parallelizeTargets -target installAndroid Build and Install
Set these environment variables inside a Developer Command Prompt for VS 2019.
git clone https://github.com/jbeder/yaml-cpp/cd yaml-cppgit checkout -b gamekit_fixed_version 2f899756mkdir build_androidcd build_androidGTest
Windows Build and Install
D:\development), navigate into it and clone:git clone https://github.com/google/googletest. You should end up having a directory tree likeD:\development\googletest.D:\development\googletest\googletest.cmake -DBUILD_SHARED_LIBS=ON -Dgtest_force_shared_crt=ON -DCMAKE_INSTALL_PREFIX=<path to gtest repo>\build\install -DGTEST_CREATE_SHARED_LIBRARY=1 .."C:\Program Files (x86)\Microsoft Visual Studio019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=Debug -maxcpucountmacOS Build and Install
cdinto the directory where you cloned googletestmkdir build_maccd build_maccmake -G Xcode -DBUILD_SHARED_LIBS=ON -Dgtest_force_shared_crt=ON -DCMAKE_INSTALL_PREFIX=install/x86_64 -DGTEST_CREATE_SHARED_LIBRARY=1 ..xcodebuild -parallelizeTargets -target ALL_BUILDxcodebuild -parallelizeTargets -target installiOS Build and Install
Android Build and Install
Set these environment variables inside a Developer Command Prompt for VS 2019.
Clone https://github.com/google/googletest
cdinto the directory where you cloned googletestmkdir build_androidcd build_androidBoost
Windows Build and Install
cdinto the directory you extracted Boostbootstrap.bat.\b2 link=staticmacOS Build and Install
cdinto the directory you extracted Boost./bootstrap.sh./b2 link=staticiOS Build and Install
~/development/ios-boost.r+wpermissions to all files in this folder withchmod.1.76.0(or whichever one we are currently using for win64 and macos).BOOST_LIBS="regex filesystem iostreams"./boost.sh -ios.<BOOST_PARENT_DIR>\boost_1_76_0) when asked for the boost path in thescripts/aws_gamekit_cpp_build.pybuild script since the build needs boost source/includes. Use theios-boostdirectory when prompted for the boost path in thescripts/refresh_plugin.pyscript that copies ios static libs.Android Build and Install
Set these environment variables inside a Developer Command Prompt for VS 2019.
Copy the
scripts\Android\sample-android-user-config.jamto your User directory with the nameuser-config.jame.g.C:\users\<your username>\user-config.jam.Note: Remember to remove or rename this file after building Boost for Android, otherwise all future Boost builds will use this configuration.
Download and extract https://www.boost.org/users/history/version_1_76_0.html. Make sure it’s in a separate folder from the boost folder for win64 and macos, for example:
~/development/android-boost.cdinto the directory you extracted BoostRun
bootstrap.bat --with-libraries=regex,filesystem,iostreamsOpen
boostcpp.jamin your boost dir and addandroidto the platforms on line 210, so it ends up as Then, run in the Command Promptpybind11
Windows Build and Install
python3is on yourPATHcdinto the directory where you cloned pybind11cmake -DBoost_INCLUDE_DIR=<BOOST_PARENT_DIR>\boost_1_76_0 -DCMAKE_INSTALL_PREFIX=<PYBIND_PARENT_DIR>\pybind11\install\<BUILD_TYPE> ."C:\Program Files (x86)\Microsoft Visual Studio019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=<BUILD_TYPE> -maxcpucountmacOS Build and Install
cdinto the directory where you cloned pybind11cmake -DBOOST_ROOT=<BOOST_PARENT_DIR>/boost_1_76_0 .makesudo make installiOS Build and Install
Not supported.
Android Build and Install
Not supported.
Build GameKit C++
Use the
scripts/aws_gamekit_cpp_build.pyutility to generate project files and compile for the specified platform.python scripts/aws_gamekit_cpp_build.py <Platform> <Platform specific arguments> <BUILD_TYPE>python scripts/aws_gamekit_cpp_build.py Windows --test Debug--helpto see all arguments and directions. If used after supplying a platform it will list and explain platform sepecific arguments.The script will first search your environment variables for dependency path variables. If they are not present there, it will search in the
.envfile at the root of this repository (created by running this script), else it will prompt you for input on where the dependencies are located and save those locations in the.envfile.Run Unit Tests
Windows
cdintotests\<BUILD_TYPE>directoryaws-gamekit-cpp-tests.exemacOS
tests/Debugdirectory./aws-gamekit-cpp-testsUpdate Plugin with new binaries and headers
Use the
scripts/refresh_plugin.pyscript to update your game engine plugin with the new libraries and header files.python scripts/refresh_plugin.py --platform <target_platform> <BuildType> <GameEngine> <game engine specific arguments>python scripts/refresh_plugin.py --platform Windows Debug Unreal --unreal_plugin_path D:\development\MyUnrealGame\Plugins\AwsGameKitpython scripts/refresh_plugin.py --platform Windows Debug Unity --unity_plugin_path D:\development\MyUnityGame\Packages\com.amazonaws.gamekit--helpwith the script to see argument options, and using--helpafter supplying aGameEngineargument, it will list and explain game engine specific arguments.--certificate_nameargument and give a Developer ID Application certificate common name.