aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

Unreal Support

Open jmklix opened this issue 1 year ago • 8 comments

Describe the feature

official support for Unreal engine for use with aws-sdk-cpp

Related issues/discussions:

  • https://github.com/aws/aws-sdk-cpp/issues/2359
  • https://github.com/aws/aws-sdk-cpp/issues/2120
  • https://github.com/aws/aws-sdk-cpp/issues/1682
  • https://github.com/aws/aws-sdk-cpp/discussions/2168
  • https://github.com/aws/aws-sdk-cpp/discussions/2302
  • https://github.com/aws/aws-sdk-cpp/discussions/2001
  • https://github.com/aws/aws-sdk-cpp/issues/678
  • https://github.com/aws/aws-sdk-cpp/issues/1530
  • https://github.com/aws/aws-sdk-cpp/issues/2122

Use Case

Use Unreal engine with the aws-sdk-cpp

Proposed Solution

No response

Other Information

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue, please leave a comment

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

jmklix avatar Feb 28 '23 00:02 jmklix

Hey

Nice to see that. I've been more or less sucessfully able to compile/cross compile sdk for windows/linux using unreal build automation.

If it going to be any of help here are scripts I've been using: Windows:

set AWS_SDK_VERSION=1.11.45
@rem Engine Folders
set ENGINE_ROOT=%~dp0..\..\..\Engine\
set THIRDPARTY_ROOT=%ENGINE_ROOT%\Source\ThirdParty
set OUTPUT=\

set CURL_VERSION=7.83.1
set CURL_ROOT=%THIRDPARTY_ROOT%\libcurl\%PROTOBUF_VERSION%
set CURL_INCLUDE_ROOT=%PROTOBUF_ROOT%\include
set CURL_LIB_ROOT=%PROTOBUF_ROOT%\lib\Win64\Release

@rem OpenSSL Lib Variables
set OPENSSL_VERSION=1.1.1t
set OPENSSL_ROOT=%THIRDPARTY_ROOT%\OpenSSL\%OPENSSL_VERSION%
set OPENSSL_LIB_ROOT=%OPENSSL_ROOT%\lib\Win64\VS2015\Release
set OPENSSL_INCLUDE_ROOT=%OPENSSL_ROOT%\include\Win64\VS2015

@rem ZLib Lib Variables
set ZLIB_VERSION=1.2.13
set ZLIB_ROOT=%THIRDPARTY_ROOT%\zlib\%ZLIB_VERSION%
set ZLIB_LIB_ROOT=%ZLIB_ROOT%\lib\Win64\Release

@rem Configure CMake Args + Run
set CMAKE_ADDITIONAL_ARGUMENTS=-DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=OFF -DENABLE_UNITY_BUILD=1 -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DENABLE_ZLIB_REQUEST_COMPRESSION=OFF -DENABLE_TESTING=OFF -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs"
set CMAKE_ZLIB_ARGUMENTS=-DZLIB_LIBRARY=%ZLIB_LIB_ROOT%\zlibstatic.lib -DZLIB_INCLUDE_DIR=%ZLIB_ROOT%\include\
set CMAKE_OPENSSL_ARGUMENTS= -DOPENSSL_INCLUDE_DIR=%OPENSSL_INCLUDE_ROOT% -DOPENSSL_USE_STATIC_LIBS=ON
set CURL_ARGS=-DCURL_INCLUDE_DIR=%CURL_INCLUDE_ROOT% -DCURL_LIBRARY=%CURL_LIB_ROOT%
set TARGET_LIBS=-DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs;dynamodbstreams;eventbridge;events;sns;"
call "%ENGINE_ROOT%\Build\BatchFiles\RunUAT.bat" BuildCMakeLib -TargetPlatform=Win64 -TargetArchitecture=x64 -TargetLib=aws-sdk -TargetLibVersion=%AWS_SDK_VERSION% -TargetLibSourcePath=G:\SurvivalGame\ArcGame\Plugins\AwsSDK\aws-sdk-cpp -TargetConfigs=Release -UseCMakeInstallPrefix -CMakeGenerator=VS2022 -CMakeAdditionalArguments="%CMAKE_ADDITIONAL_ARGUMENTS% %CMAKE_ZLIB_ARGUMENTS% %CMAKE_OPENSSL_ARGUMENTS% %TARGET_LIBS% %CURL_ARGS%" -SkipCreateChangelist -SkipSubmit || exit ```shell

Linux:

set AWS_SDK_VERSION=1.11.45
@rem Engine Folders
set ENGINE_ROOT=G:/SurvivalGame/Engine
set THIRDPARTY_ROOT=%ENGINE_ROOT%/Source/ThirdParty

set CURL_VERSION=7.83.1
set CURL_ROOT=%THIRDPARTY_ROOT%/libcurl/%CURL_VERSION%
set CURL_INCLUDE_ROOT=%CURL_ROOT%/include
set CURL_LIB_ROOT=%CURL_ROOT%/lib/Unix/x86_64-unknown-linux-gnu/Release/libcurl.a
@rem OpenSSL Lib Variables
set OPENSSL_VERSION=1.1.1t
set OPENSSL_ROOT=%THIRDPARTY_ROOT%/OpenSSL/%OPENSSL_VERSION%
set OPENSSL_LIB_ROOT=%OPENSSL_ROOT%/lib/Unix/x86_64-unknown-linux-gnu
set OPENSSL_INCLUDE_ROOT=%OPENSSL_ROOT%/include/Unix/x86_64-unknown-linux-gnu
set CMAKE_OPENSSL_ARGUMENTS=-DOPENSSL_CRYPTO_LIBRARY=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/lib/Unix/x86_64-unknown-linux-gnu/libcrypto.a -DOPENSSL_SSL_LIBRARY=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/lib/Unix/x86_64-unknown-linux-gnu/libssl.a -DOPENSSL_INCLUDE_DIR=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/include/Unix -DOPENSSL_USE_STATIC_LIBS=ON -Dcrypto_LIBRARY=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/lib/Unix/x86_64-unknown-linux-gnu/libcrypto.a -Dcrypto_INCLUDE_DIR=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/include/Unix

@rem ZLib Lib Variables
set ZLIB_VERSION=1.2.13
set ZLIB_ROOT=%THIRDPARTY_ROOT%/lib/%ZLIB_VERSION%
set ZLIB_LIB_ROOT=%ZLIB_ROOT%/lib/Unix/x86_64-unknown-linux-gnu/Release

@rem Configure CMake Args + Run -DTARGET_ARCH="LINUX"
set CMAKE_ADDITIONAL_ARGUMENTS= -DUSE_OPENSSL=ON -DTARGET_ARCH="LINUX" -DFORCE_CURL=ON -DCMAKE_OBJECT_PATH_MAX=4096 -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=OFF -DBUILD_WITH_LIBCXX=ON -DCMAKE_CXX_COMPILER_WORKS=TRUE -DENABLE_UNITY_BUILD=1 -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DENABLE_ZLIB_REQUEST_COMPRESSION=OFF -DENABLE_TESTING=OFF -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs;dynamodbstreams;eventnridge;events;sns;"
set CMAKE_ZLIB_ARGUMENTS=-DZLIB_LIBRARY=%ZLIB_LIB_ROOT%/libz.a -DZLIB_INCLUDE_DIR=%ZLIB_ROOT%/include
@rem set CMAKE_OPENSSL_ARGUMENTS= -DOPENSSL_INCLUDE_DIR=%OPENSSL_INCLUDE_ROOT% -DOPENSSL_USE_STATIC_LIBS=ON
set CURL_ARGS=-DCURL_INCLUDE_DIR=%CURL_INCLUDE_ROOT% -DCURL_LIBRARY=%CURL_LIB_ROOT%
set TARGET_LIBS=-DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs;dynamodbstreams;eventnridge;events;sns;"
call "%ENGINE_ROOT%\Build\BatchFiles\RunUAT.bat" BuildCMakeLib -TargetPlatform=Unix -TargetArchitecture=x86_64-unknown-linux-gnu -TargetLib=aws-sdk -TargetLibVersion=%AWS_SDK_VERSION% -TargetLibSourcePath=G:/SurvivalGame/ArcGame/Plugins/AwsSDK/aws-sdk-cpp -TargetConfigs=Release -UseCMakeInstallPrefix -CMakeGenerator=Makefile -CMakeAdditionalArguments="%CMAKE_ADDITIONAL_ARGUMENTS% %CMAKE_ZLIB_ARGUMENTS% %CMAKE_OPENSSL_ARGUMENTS% %TARGET_LIBS% %CURL_ARGS%" -SkipCreateChangelist -SkipSubmit || exit ```shell

And that's how my build.cs looks now:

public class AwsSDKLibs : ModuleRules
{
    public AwsSDKLibs(ReadOnlyTargetRules Target) : base(Target)
    {
	    Type = ModuleType.External;
	    
	    if (Target.Platform == UnrealTargetPlatform.Linux)
	    {
		    PublicDefinitions.Add("__linux__config__");
		    List<string> Libs = new List<string> 
		    {
			    "libaws-c-auth.a"
			    , "libaws-c-cal.a"
			    , "libaws-c-common.a"
			    , "libaws-c-compression.a"
			    , "libaws-c-event-stream.a"
			    , "libaws-checksums.a"
			    , "libaws-c-http.a"
			    , "libaws-c-io.a"
			    , "libaws-c-mqtt.a"
			    , "libaws-crt-cpp.a"
			    , "libaws-c-s3.a"
			    , "libaws-c-sdkutils.a"
			    , "libs2n.a"
			    , "libaws-cpp-sdk-core.a"
			    //, "libaws-cpp-sdk-cur.a"
			    //, "libaws-cpp-sdk-config.a"
			    , "libaws-cpp-sdk-lambda.a"
		    };

		    foreach (string lib in Libs)
		    {
			    PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "Unix", "x86_64-unknown-linux-gnu", "Release", lib));
		    }
		    
		    PublicDefinitions.Add("__clang_analyzer__=1");
		    PublicDefinitions.Add("AWS_DEEP_CHECKS=0");
		    PublicDefinitions.Add("AWS_USE_IO_COMPLETION_PORTS=1");
	    }
	    else if (Target.Platform == UnrealTargetPlatform.Win64)
	    {
		    PublicDefinitions.Add("__win64__config__");

		    List<string> Libs = new List<string> 
		    {
			    "aws-c-auth.lib"
			    , "aws-c-cal.lib"
			    , "aws-c-common.lib"
			    , "aws-c-compression.lib"
			    , "aws-c-event-stream.lib"
			    , "aws-checksums.lib"
			    , "aws-c-http.lib"
			    , "aws-c-io.lib"
			    , "aws-c-mqtt.lib"
			    , "aws-crt-cpp.lib"
			    , "aws-c-s3.lib"
			    , "aws-c-sdkutils.lib"
			    , "aws-cpp-sdk-core.lib"
			    , "aws-cpp-sdk-cur.lib"
			    , "aws-cpp-sdk-config.lib"
			    , "aws-cpp-sdk-lambda.lib"
		    };

		    foreach (string lib in Libs)
		    {
			    PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "Win64", "x64", "Release", lib));
		    }
		    
		    PublicSystemLibraries.AddRange(
			    new string[]
			    {
				    "Ncrypt.lib",
				    "BCrypt.lib",
				    "Crypt32.lib",
				    "Secur32.lib",
				    "Shlwapi.lib",
				    "Userenv.lib",
				    "version.lib",
				    "winhttp.lib",
				    "Ws2_32.lib"
			    });
		    
		    // Add any macros that need to be set
		    PublicDefinitions.Add("__clang_analyzer__=0");
		    PublicDefinitions.Add("AWS_DEEP_CHECKS=0");
		    PublicDefinitions.Add("AWS_USE_IO_COMPLETION_PORTS=1");
	    }
        
        // Add any include paths for the plugin
        PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "include"));
    }
}

CMake seems to be producing some generated code, which the unreal utility can't handle, and I had to manually go to intermediate folder and manually copy if (before it got auto deleted).

Hope it will be helpful.

iniside avatar Mar 26 '23 11:03 iniside

is unreal engine 5 supported or not: Followed this walkthrough and it fails?? https://aws.amazon.com/blogs/gametech/how-to-integrate-the-aws-c-sdk-with-unreal-engine/

Can we get official answer rom aws as its your sdk.

There is a unreal engine 4 demo that appears to work however cannot get it to work with unreal engine 5. Think its the aws sdk for unreal engine 5

https://github.com/aws-samples/amazon-polly-metahumans

BlockchainPunks avatar Oct 28 '23 06:10 BlockchainPunks

anyone have a working version of unreal engine 5 with aws sdk ? work demo project with scripts will really help

BlockchainPunks avatar Oct 28 '23 20:10 BlockchainPunks

I've started building a SDK for Unreal Engine here: aws-sdk-unreal.

It has the setup steps fully automated using vcpkg - building, copying, initialization. So far only tested with 5.3 on Windows, Mac & iOS.

It will require some more testing to ensure it fully supports all the platforms and configuration, but it's time to put all the fixes of the community in one place.

pasotee avatar Jan 01 '24 08:01 pasotee

I've started building a SDK for Unreal Engine here: aws-sdk-unreal.

It has the setup steps fully automated using vcpkg - building, copying, initialization. So far only tested with 5.3 on Windows, Mac & iOS.

It will require some more testing to ensure it fully supports all the platforms and configuration, but it's time to put all the fixes of the community in one place.

AWS SDK causes major issues with Linux. Primarily because vcpkg utilizes g++ for compilation while Unreal uses clang. This causes issues with std symbols specially, because g++ uses libstd while clang uses libc++ as standard library (as far as I know)

I managed to clean up a lot of the errors, but not all. Hopefully, you were better at it than me brother. I will test your plugin soon.

M-AliTanveer avatar Jan 08 '24 07:01 M-AliTanveer

AWS SDK causes major issues with Linux. Primarily because vcpkg utilizes g++ for compilation while Unreal uses clang. This causes issues with std symbols specially, because g++ uses libstd while clang uses libc++ as standard library (as far as I know)

I managed to clean up a lot of the errors, but not all. Hopefully, you were better at it than me brother. I will test your plugin soon.

That is a great point. The aws-sdk-unreal relies on custom triplets to compile the binaries according to Unreal's standards.

For your specific Linux case, we don't have a dedicated triplet, but I wrote on in the past here: x64-linux-unreal. If you need to plugin to work on Linux, let's work together and I can write for triplet file for you.

pasotee avatar Jan 08 '24 07:01 pasotee

AWS SDK causes major issues with Linux. Primarily because vcpkg utilizes g++ for compilation while Unreal uses clang. This causes issues with std symbols specially, because g++ uses libstd while clang uses libc++ as standard library (as far as I know) I managed to clean up a lot of the errors, but not all. Hopefully, you were better at it than me brother. I will test your plugin soon.

That is a great point. The aws-sdk-unreal relies on custom triplets to compile the binaries according to Unreal's standards.

For your specific Linux case, we don't have a dedicated triplet, but I wrote on in the past here: x64-linux-unreal. If you need to plugin to work on Linux, let's work together and I can write for triplet file for you.

Sure. Contacted via Email

M-AliTanveer avatar Jan 08 '24 08:01 M-AliTanveer

Hey

Nice to see that. I've been more or less sucessfully able to compile/cross compile sdk for windows/linux using unreal build automation.

If it going to be any of help here are scripts I've been using: Windows:

set AWS_SDK_VERSION=1.11.45
@rem Engine Folders
set ENGINE_ROOT=%~dp0..\..\..\Engine\
set THIRDPARTY_ROOT=%ENGINE_ROOT%\Source\ThirdParty
set OUTPUT=\

set CURL_VERSION=7.83.1
set CURL_ROOT=%THIRDPARTY_ROOT%\libcurl\%PROTOBUF_VERSION%
set CURL_INCLUDE_ROOT=%PROTOBUF_ROOT%\include
set CURL_LIB_ROOT=%PROTOBUF_ROOT%\lib\Win64\Release

@rem OpenSSL Lib Variables
set OPENSSL_VERSION=1.1.1t
set OPENSSL_ROOT=%THIRDPARTY_ROOT%\OpenSSL\%OPENSSL_VERSION%
set OPENSSL_LIB_ROOT=%OPENSSL_ROOT%\lib\Win64\VS2015\Release
set OPENSSL_INCLUDE_ROOT=%OPENSSL_ROOT%\include\Win64\VS2015

@rem ZLib Lib Variables
set ZLIB_VERSION=1.2.13
set ZLIB_ROOT=%THIRDPARTY_ROOT%\zlib\%ZLIB_VERSION%
set ZLIB_LIB_ROOT=%ZLIB_ROOT%\lib\Win64\Release

@rem Configure CMake Args + Run
set CMAKE_ADDITIONAL_ARGUMENTS=-DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=OFF -DENABLE_UNITY_BUILD=1 -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DENABLE_ZLIB_REQUEST_COMPRESSION=OFF -DENABLE_TESTING=OFF -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs"
set CMAKE_ZLIB_ARGUMENTS=-DZLIB_LIBRARY=%ZLIB_LIB_ROOT%\zlibstatic.lib -DZLIB_INCLUDE_DIR=%ZLIB_ROOT%\include\
set CMAKE_OPENSSL_ARGUMENTS= -DOPENSSL_INCLUDE_DIR=%OPENSSL_INCLUDE_ROOT% -DOPENSSL_USE_STATIC_LIBS=ON
set CURL_ARGS=-DCURL_INCLUDE_DIR=%CURL_INCLUDE_ROOT% -DCURL_LIBRARY=%CURL_LIB_ROOT%
set TARGET_LIBS=-DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs;dynamodbstreams;eventbridge;events;sns;"
call "%ENGINE_ROOT%\Build\BatchFiles\RunUAT.bat" BuildCMakeLib -TargetPlatform=Win64 -TargetArchitecture=x64 -TargetLib=aws-sdk -TargetLibVersion=%AWS_SDK_VERSION% -TargetLibSourcePath=G:\SurvivalGame\ArcGame\Plugins\AwsSDK\aws-sdk-cpp -TargetConfigs=Release -UseCMakeInstallPrefix -CMakeGenerator=VS2022 -CMakeAdditionalArguments="%CMAKE_ADDITIONAL_ARGUMENTS% %CMAKE_ZLIB_ARGUMENTS% %CMAKE_OPENSSL_ARGUMENTS% %TARGET_LIBS% %CURL_ARGS%" -SkipCreateChangelist -SkipSubmit || exit ```shell

Linux:

set AWS_SDK_VERSION=1.11.45
@rem Engine Folders
set ENGINE_ROOT=G:/SurvivalGame/Engine
set THIRDPARTY_ROOT=%ENGINE_ROOT%/Source/ThirdParty

set CURL_VERSION=7.83.1
set CURL_ROOT=%THIRDPARTY_ROOT%/libcurl/%CURL_VERSION%
set CURL_INCLUDE_ROOT=%CURL_ROOT%/include
set CURL_LIB_ROOT=%CURL_ROOT%/lib/Unix/x86_64-unknown-linux-gnu/Release/libcurl.a
@rem OpenSSL Lib Variables
set OPENSSL_VERSION=1.1.1t
set OPENSSL_ROOT=%THIRDPARTY_ROOT%/OpenSSL/%OPENSSL_VERSION%
set OPENSSL_LIB_ROOT=%OPENSSL_ROOT%/lib/Unix/x86_64-unknown-linux-gnu
set OPENSSL_INCLUDE_ROOT=%OPENSSL_ROOT%/include/Unix/x86_64-unknown-linux-gnu
set CMAKE_OPENSSL_ARGUMENTS=-DOPENSSL_CRYPTO_LIBRARY=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/lib/Unix/x86_64-unknown-linux-gnu/libcrypto.a -DOPENSSL_SSL_LIBRARY=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/lib/Unix/x86_64-unknown-linux-gnu/libssl.a -DOPENSSL_INCLUDE_DIR=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/include/Unix -DOPENSSL_USE_STATIC_LIBS=ON -Dcrypto_LIBRARY=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/lib/Unix/x86_64-unknown-linux-gnu/libcrypto.a -Dcrypto_INCLUDE_DIR=%THIRDPARTY_ROOT%/OpenSSL/1.1.1t/include/Unix

@rem ZLib Lib Variables
set ZLIB_VERSION=1.2.13
set ZLIB_ROOT=%THIRDPARTY_ROOT%/lib/%ZLIB_VERSION%
set ZLIB_LIB_ROOT=%ZLIB_ROOT%/lib/Unix/x86_64-unknown-linux-gnu/Release

@rem Configure CMake Args + Run -DTARGET_ARCH="LINUX"
set CMAKE_ADDITIONAL_ARGUMENTS= -DUSE_OPENSSL=ON -DTARGET_ARCH="LINUX" -DFORCE_CURL=ON -DCMAKE_OBJECT_PATH_MAX=4096 -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=OFF -DBUILD_WITH_LIBCXX=ON -DCMAKE_CXX_COMPILER_WORKS=TRUE -DENABLE_UNITY_BUILD=1 -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DENABLE_ZLIB_REQUEST_COMPRESSION=OFF -DENABLE_TESTING=OFF -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs;dynamodbstreams;eventnridge;events;sns;"
set CMAKE_ZLIB_ARGUMENTS=-DZLIB_LIBRARY=%ZLIB_LIB_ROOT%/libz.a -DZLIB_INCLUDE_DIR=%ZLIB_ROOT%/include
@rem set CMAKE_OPENSSL_ARGUMENTS= -DOPENSSL_INCLUDE_DIR=%OPENSSL_INCLUDE_ROOT% -DOPENSSL_USE_STATIC_LIBS=ON
set CURL_ARGS=-DCURL_INCLUDE_DIR=%CURL_INCLUDE_ROOT% -DCURL_LIBRARY=%CURL_LIB_ROOT%
set TARGET_LIBS=-DBUILD_ONLY="lambda;s3;dynamodb;cognito-identity;gamelift;gamesparks;sqs;dynamodbstreams;eventnridge;events;sns;"
call "%ENGINE_ROOT%\Build\BatchFiles\RunUAT.bat" BuildCMakeLib -TargetPlatform=Unix -TargetArchitecture=x86_64-unknown-linux-gnu -TargetLib=aws-sdk -TargetLibVersion=%AWS_SDK_VERSION% -TargetLibSourcePath=G:/SurvivalGame/ArcGame/Plugins/AwsSDK/aws-sdk-cpp -TargetConfigs=Release -UseCMakeInstallPrefix -CMakeGenerator=Makefile -CMakeAdditionalArguments="%CMAKE_ADDITIONAL_ARGUMENTS% %CMAKE_ZLIB_ARGUMENTS% %CMAKE_OPENSSL_ARGUMENTS% %TARGET_LIBS% %CURL_ARGS%" -SkipCreateChangelist -SkipSubmit || exit ```shell

And that's how my build.cs looks now:

public class AwsSDKLibs : ModuleRules
{
    public AwsSDKLibs(ReadOnlyTargetRules Target) : base(Target)
    {
	    Type = ModuleType.External;
	    
	    if (Target.Platform == UnrealTargetPlatform.Linux)
	    {
		    PublicDefinitions.Add("__linux__config__");
		    List<string> Libs = new List<string> 
		    {
			    "libaws-c-auth.a"
			    , "libaws-c-cal.a"
			    , "libaws-c-common.a"
			    , "libaws-c-compression.a"
			    , "libaws-c-event-stream.a"
			    , "libaws-checksums.a"
			    , "libaws-c-http.a"
			    , "libaws-c-io.a"
			    , "libaws-c-mqtt.a"
			    , "libaws-crt-cpp.a"
			    , "libaws-c-s3.a"
			    , "libaws-c-sdkutils.a"
			    , "libs2n.a"
			    , "libaws-cpp-sdk-core.a"
			    //, "libaws-cpp-sdk-cur.a"
			    //, "libaws-cpp-sdk-config.a"
			    , "libaws-cpp-sdk-lambda.a"
		    };

		    foreach (string lib in Libs)
		    {
			    PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "Unix", "x86_64-unknown-linux-gnu", "Release", lib));
		    }
		    
		    PublicDefinitions.Add("__clang_analyzer__=1");
		    PublicDefinitions.Add("AWS_DEEP_CHECKS=0");
		    PublicDefinitions.Add("AWS_USE_IO_COMPLETION_PORTS=1");
	    }
	    else if (Target.Platform == UnrealTargetPlatform.Win64)
	    {
		    PublicDefinitions.Add("__win64__config__");

		    List<string> Libs = new List<string> 
		    {
			    "aws-c-auth.lib"
			    , "aws-c-cal.lib"
			    , "aws-c-common.lib"
			    , "aws-c-compression.lib"
			    , "aws-c-event-stream.lib"
			    , "aws-checksums.lib"
			    , "aws-c-http.lib"
			    , "aws-c-io.lib"
			    , "aws-c-mqtt.lib"
			    , "aws-crt-cpp.lib"
			    , "aws-c-s3.lib"
			    , "aws-c-sdkutils.lib"
			    , "aws-cpp-sdk-core.lib"
			    , "aws-cpp-sdk-cur.lib"
			    , "aws-cpp-sdk-config.lib"
			    , "aws-cpp-sdk-lambda.lib"
		    };

		    foreach (string lib in Libs)
		    {
			    PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "Win64", "x64", "Release", lib));
		    }
		    
		    PublicSystemLibraries.AddRange(
			    new string[]
			    {
				    "Ncrypt.lib",
				    "BCrypt.lib",
				    "Crypt32.lib",
				    "Secur32.lib",
				    "Shlwapi.lib",
				    "Userenv.lib",
				    "version.lib",
				    "winhttp.lib",
				    "Ws2_32.lib"
			    });
		    
		    // Add any macros that need to be set
		    PublicDefinitions.Add("__clang_analyzer__=0");
		    PublicDefinitions.Add("AWS_DEEP_CHECKS=0");
		    PublicDefinitions.Add("AWS_USE_IO_COMPLETION_PORTS=1");
	    }
        
        // Add any include paths for the plugin
        PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "include"));
    }
}

CMake seems to be producing some generated code, which the unreal utility can't handle, and I had to manually go to intermediate folder and manually copy if (before it got auto deleted).

Hope it will be helpful.

How to remove the P4 issue while building the AWS SDK Library

abendigeri avatar Apr 08 '24 23:04 abendigeri