Download and Install CMake v3.21 Some versions of aws-sdk-cpp have a known issue compiling with CMake 3.22.
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:
Set-ItemProperty `
-Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem `
-Name LongPathsEnabled -Value 1
Build and Install the dependencies in the following order:
- AWS SDK C++
- yaml-cpp
- GTest
- Boost
- Pybind
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
- Needs Xcode 13.1 or above
- 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
- If multiple Xcode versions are installed,
run:
- run:
./build.sh -e
Boost: Get the shell script that will download, bootstrap, and build Boost for iOS from: https://gist.github.com/faithfracture/c629ae4c7168216a9856#file-boost-sh.
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 Studio\2019\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 r21d: Use Unreal's NDK, follow these steps to install: https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/Setup/AndroidStudio/
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:
- 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 theAndroid SDK Build Tools
- Uninstall newer versions of the SDK Build Tools
Note: BUILD_TYPE
is either Debug
or Release
- 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.
mkdir AWSSDK
- Change directory into AWSSDK:
cd AWSSDK
- Generate the SDK Project files (~5 min):
cmake <YOUR_DEVELOPMENT_PATH>\aws-sdk-cpp -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=<BUILD_TYPE> -DFORCE_SHARED_CRT=ON -DBUILD_SHARED_LIBS=ON -DMINIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=<YOUR_DEVELOPMENT_PATH>\AWSSDK\install\x86_64\windows\<BUILD_TYPE>
- Build the SDK (~10 min depends on your workstation specs):
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\msbuild.exe" ALL_BUILD.vcxproj /p:Configuration=<BUILD_TYPE> -maxcpucount
- Install the SDK to the <YOUR_DEVELOPMENT_PATH>\AWSSDK\install location
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=<BUILD_TYPE> -maxcpucount
- 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)
- Make sure to use the same tag for
- Install CMake: https://cmake.org/download/
- For both macOS and iOS, you will need to pull in the tag
v0.17.13
forcrt/aws-crt-cpp
submodule ofaws-sdk-cpp
. This fixes a bug for iOS builds related toSetKeychainPath
. Make sure toinit
and recursiveupdate
further submodules ofaws-crt-cpp
.
- Create a build directory called AWSSDK_mac e.g.,
~/development/AWSSDK_mac
mkdir AWSSDK_mac
- Change directory into AWSSDK_mac:
cd AWSSDK_mac
- Run CMake
rm -rf CMakeFiles/; rm -rf CMakeScripts/; rm CMakeCache.txt; rm -rf crt/aws-crt-cpp/CMakeFiles/; rm -rf crt/aws-crt-cpp/CMakeScripts/;
cmake ~/development/aws-sdk-cpp -G Xcode -DCMAKE_BUILD_TYPE=<BUILD_TYPE> -DBUILD_ONLY="core;apigateway;cloudformation;cognito-idp;lambda;s3;ssm;secretsmanager;sts" -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=<YOUR_DEVELOPMENT_PATH>/AWSSDK_mac/install/x86_64/macos/<BUILD_TYPE> -DTARGET_ARCH="APPLE" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
- Build and install
xcodebuild -parallelizeTargets -configuration <BUILD_TYPE> -target ALL_BUILD
xcodebuild -parallelizeTargets -target install
- Create a build directory called AWSSDK_ios e.g.,
~/development/AWSSDK_ios
mkdir AWSSDK_ios
- Change directory into AWSSDK_ios:
cd AWSSDK_ios
-
Run CMake Use XCode 12 to compile for iOS 14.0 which is the highest version supported by Unreal 4.27.
- If multiple Xcode versions are installed,
run:
sudo xcode-select -s <YOUR_XCODE12_APP>/Contents/Developer
example:sudo xcode-select -s /Applications/Xcode12.app/Contents/Developer
cmake ~/development/aws-sdk-cpp -G Xcode -DCMAKE_TOOLCHAIN_FILE=<YOUR_DEVELOPMENT_PATH>/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DCMAKE_BUILD_TYPE=<BUILD_TYPE> -DBUILD_ONLY="core;apigateway;cloudformation;cognito-idp;lambda;s3;ssm;secretsmanager;sts" -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<YOUR_DEVELOPMENT_PATH>/AWSSDK_ios/install/arm64/ios/<BUILD_TYPE> -DENABLE_TESTING=NO -DCURL_LIBRARY=<YOUR_DEVELOPMENT_PATH>/Build-OpenSSL-cURL/curl/lib/libcurl.a -DCURL_INCLUDE_DIR=<YOUR_DEVELOPMENT_PATH>/Build-OpenSSL-cURL/curl/include -DUSE_OPENSSL=ON -DENABLE_PROXY_INTEGRATION_TESTS=OFF -DENABLE_COMMONCRYPTO_ENCRYPTION=OFF -DENABLE_OPENSSL_ENCRYPTION=ON -DOPENSSL_ROOT_DIR=<YOUR_DEVELOPMENT_PATH>/Build-OpenSSL-cURL/openssl/iOS -DCMAKE_CXX_FLAGS="-Wno-shorten-64-to-32" -DENABLE_CURL_CLIENT=ON
- Build and install
xcodebuild -parallelizeTargets -configuration <BUILD_TYPE> -target ALL_BUILD
xcodebuild -parallelizeTargets -target 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
- Create a build directory called AWSSDK_android
mkdir AWSSDK_android
- Change directory into AWSSDK_android:
cd AWSSDK_android
- Run CMake
cmake <YOUR_DEVELOPMENT_PATH>\aws-sdk-cpp -DNDK_DIR=%NDKROOT% -DBUILD_ONLY="core;apigateway;cloudformation;cognito-idp;lambda;s3;ssm;secretsmanager;sts" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCUSTOM_MEMORY_MANAGEMENT=ON -DTARGET_ARCH=ANDROID -DANDROID_NATIVE_API_LEVEL=%ANDROID_API_LEVEL% -DANDROID_BUILD_CURL=1 -DANDROID_BUILD_OPENSSL=1 -DANDROID_BUILD_ZLIB=1 -DBUILD_ZLIB=1 -DCMAKE_INSTALL_PREFIX=<YOUR_DEVELOPMENT_PATH>\AWSSDK_android\install\%ARCH%\%PLATFORM%\%BUILD_TYPE% -G "Ninja" -DANDROID_STL=c++_static -DANDROID_PLATFORM=android-%ANDROID_API_LEVEL% -DENABLE_TESTING=NO
- Build and install
cmake --build .
cmake --build . --target install
- Before building
Release
after you have builtDebug
, make sure to delete allCMakeCache
files and also the folderexternal-build
inAWSSDK_android
root path.
AWS GameKit uses a fixed version of yaml-cpp: commit 2f899756
git clone https://github.com/jbeder/yaml-cpp/
cd yaml-cpp
git checkout -b gamekit_fixed_version 2f899756
mkdir build
cd build
cmake -DYAML_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<DIRECTORY_IN_STEP_TWO>\install\<BUILD_TYPE> ..
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=<BUILD_TYPE> -maxcpucount
git clone https://github.com/jbeder/yaml-cpp/
cd yaml-cpp
git checkout -b gamekit_fixed_version 2f899756
mkdir build_mac
cd build_mac
cmake -G Xcode -DYAML_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=install/x86_64/<BUILD_TYPE> ..
xcodebuild -parallelizeTargets -configuration <BUILD_TYPE> -target ALL_BUILD
xcodebuild -parallelizeTargets -target install
git clone https://github.com/jbeder/yaml-cpp/
(if not already cloned formacos
)cd yaml-cpp
git checkout -b gamekit_fixed_version 2f899756
mkdir build_ios
(same level asmacos
)cd build_ios
cmake -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_BUILD
xcodebuild -parallelizeTargets -target 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
git clone https://github.com/jbeder/yaml-cpp/
cd yaml-cpp
git checkout -b gamekit_fixed_version 2f899756
mkdir build_android
cd build_android
cmake .. -DCMAKE_TOOLCHAIN_FILE=%NDKROOT%\build\cmake\android.toolchain.cmake -DYAML_BUILD_SHARED_LIBS=OFF -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=%ANDROID_API_LEVEL% -DCMAKE_INSTALL_PREFIX=install\%BUILD_TYPE% -G "Ninja" -DANDROID_STL=c++_static -DBUILD_TESTING=OFF
cmake --build .
cmake --build . --target install
- 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 likeD:\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 Studio\2019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=Debug -maxcpucount
- Clone https://github.com/google/googletest
- cd into the directory where you cloned googletest
mkdir build_mac
cd build_mac
cmake -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_BUILD
xcodebuild -parallelizeTargets -target install
- Not needed.
- 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
- Clone https://github.com/google/googletest
- cd into the directory where you cloned googletest
mkdir build
cd build
cmake .. -DBUILD_SHARED_LIBS=ON -Dgtest_force_shared_crt=ON -DCMAKE_INSTALL_PREFIX=install\%BUILD_TYPE% -DGTEST_CREATE_SHARED_LIBRARY=1 -DCMAKE_TOOLCHAIN_FILE=%NDKROOT%\build\cmake\android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=%ANDROID_API_LEVEL% -G "Ninja" -DANDROID_STL=c++_static
cmake --build .
cmake --build . --target install
- Download and extract https://www.boost.org/users/history/version_1_76_0.html
- cd into the directory you extracted Boost
- run
bootstrap.bat
- run
.\b2 link=static
- Download and extract https://www.boost.org/users/history/version_1_76_0.html
- cd into the directory you extracted Boost
- run
./bootstrap.sh
- run
./b2 link=static
- Make the following updates to the script from https://gist.github.com/faithfracture/c629ae4c7168216a9856#file-boost-sh :
- 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 withchmod
. - 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"
- Make sure it's in a separate folder from the boost folder for win64 and macos, for example:
- 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 thescripts/aws_gamekit_cpp_build.py
build script since the build needs boost source/includes. Use theios-boost
directory when prompted for the boost path in thescripts/refresh_plugin.py
script that copies ios static libs.
- 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%
- Copy the
sample-android-user-config.jam
to your User directory with the nameuser-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. - 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
. - cd into the directory you extracted Boost.
- run
bootstrap.bat --with-libraries=regex,filesystem,iostreams
- run
.\b2 toolset=clang-armeabiv7a target-os=android architecture=arm --without-python threading=multi link=static --layout=tagged variant=debug,release
- Make sure
python3
is on yourPATH
- Clone https://github.com/pybind/pybind11/
- cd into the directory where you cloned pybind11
cmake -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 Studio\2019\Professional\MSBuild\Current\Bin\msbuild.exe" INSTALL.vcxproj /p:Configuration=<BUILD_TYPE> -maxcpucount
- Clone https://github.com/pybind/pybind11/
- cd into the directory where you cloned pybind11
cmake -DBOOST_ROOT=<BOOST_PARENT_DIR>/boost_1_76_0 .
make
sudo make install
Not supported.
Not supported.
Use the scripts/aws_gamekit_cpp_build.py
utility to generate project files and compile for the specified platform.
- Usage:
python scripts/aws_gamekit_cpp_build.py <Platform> <Platform specific arguments> <BUILD_TYPE>
- Example:
python scripts/aws_gamekit_cpp_build.py Windows --test Debug
- Use
--help
to 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 .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.
- cd into
tests\<BUILD_TYPE>
directory - Run
aws-gamekit-cpp-tests.exe
- cd into the
tests/Debug
directory - Run
./aws-gamekit-cpp-tests
Use the scripts/refresh_plugin.py
script to update your game engine plugin with the new libraries and header files.
- Usage:
python scripts/refresh_plugin.py --platform <target_platform> <BuildType> <GameEngine> <game engine specific arguments>
- Example:
python scripts/refresh_plugin.py --platform Windows Debug Unreal --unreal_plugin_path D:\development\MyUnrealGame\Plugins\AwsGameKit
- Use
--help
with the script to see argument options, and using--help
after supplying aGameEngine
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.