diff --git a/package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux b/package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux index e544d192..00a66dae 100644 --- a/package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux +++ b/package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux @@ -48,7 +48,12 @@ ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE $ if (LY_MONOLITHIC_GAME) target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSGAMELIFTSERVERSDK_LIBS}) else() - target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSGAMELIFTSERVERSDK_LIBS}) + # Modules using aws-cpp-sdk-gamelift-server functionality will needs pThreads to link. + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) + + target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE Threads::Threads ${AWSGAMELIFTSERVERSDK_LIBS}) ly_add_dependencies(${TARGET_WITH_NAMESPACE} ${AWSGAMELIFTSERVERSDK_LIBS}) endif() diff --git a/package-system/AWSGameLiftServerSDK/aws_gamelift_5.0.0.patch b/package-system/AWSGameLiftServerSDK/aws_gamelift_5.0.0.patch deleted file mode 100644 index 4e144541..00000000 --- a/package-system/AWSGameLiftServerSDK/aws_gamelift_5.0.0.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --unified --recursive --no-dereference a/GameLift-Cpp-ServerSDK-5.0.0/gamelift-server-sdk/include/aws/gamelift/internal/model/request/UpdatePlayerSessionCreationPolicyRequest.h b/GameLift-Cpp-ServerSDK-5.0.0/gamelift-server-sdk/include/aws/gamelift/internal/model/request/UpdatePlayerSessionCreationPolicyRequest.h ---- a/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/gamelift-server-sdk/include/aws/gamelift/internal/model/request/UpdatePlayerSessionCreationPolicyRequest.h 2023-02-08 13:28:26.000000000 -0800 -+++ b/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/gamelift-server-sdk/include/aws/gamelift/internal/model/request/UpdatePlayerSessionCreationPolicyRequest.h 2023-05-08 07:52:32.249104692 -0700 -@@ -114,7 +114,7 @@ - static constexpr const char* NOT_SET = "NOT_SET"; - - std::string m_gameSessionId; -- WebSocketPlayerSessionCreationPolicy m_playerSessionCreationPolicy; -+ WebSocketPlayerSessionCreationPolicy m_playerSessionCreationPolicy = WebSocketPlayerSessionCreationPolicy::NOT_SET; - }; - } // namespace Internal - } // namespace GameLift diff --git a/package-system/AWSGameLiftServerSDK/build_config.json b/package-system/AWSGameLiftServerSDK/build_config.json index a018bab7..9a5f988f 100644 --- a/package-system/AWSGameLiftServerSDK/build_config.json +++ b/package-system/AWSGameLiftServerSDK/build_config.json @@ -1,11 +1,11 @@ { - "src_package_url": "https://gamelift-release.s3-us-west-2.amazonaws.com/GameLift-SDK-Release-5.0.0.zip", - "src_package_sha1": "25cfa89252a934925c14830ba75e91855bf02e5d", + "src_package_url": "https://gamelift-server-sdk-release.s3.us-west-2.amazonaws.com/cpp/GameLift-Cpp-ServerSDK-5.1.1.zip", + "src_package_sha1": "847dea8ec09b404e2aa6599a436b6c902c4dfe0e", "package_name": "AWSGameLiftServerSDK", - "package_version": "5.0.0-rev3", + "package_version": "5.1.1-rev1", "package_url": "https://aws.amazon.com/documentation/gamelift/", "package_license": "Apache-2.0", - "package_license_file": "GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/LICENSE_AMAZON_GAMELIFT_SDK.TXT", + "package_license_file": "GameLift-Cpp-ServerSDK-5.1.1/LICENSE_AMAZON_GAMELIFT_SDK.TXT", "cmake_find_target": "FindAWSGameLiftServerSDK.cmake", "Platforms": { "Linux": { @@ -13,11 +13,10 @@ "depends_on_packages": [ [ "OpenSSL-1.1.1t-rev1-linux", "63aea898b7afe8faccd0c7261e62d2f8b7b870f678a4520d5be81e5815542b39", "" ] ], - "patch_file":"aws_gamelift_5.0.0.patch", "cmake_find_source": "FindAWSGameLiftServerSDK.cmake.Linux", "custom_build_cmd": [ "./build-linux.sh", - "aws_gamelift_5_5_0", + "aws_gamelift_5_1_1", "20.04", "x86_64" ], @@ -33,11 +32,10 @@ "depends_on_packages": [ [ "OpenSSL-1.1.1t-rev1-linux-aarch64", "f32721bec9c82d1bd7fb244d78d5dc4e2a47e7b808bb36027236ad377e241ea5", "" ] ], - "patch_file":"aws_gamelift_5.0.0.patch", "cmake_find_source": "FindAWSGameLiftServerSDK.cmake.Linux", "custom_build_cmd": [ "./build-linux.sh", - "aws_gamelift_5_5_0", + "aws_gamelift_5_1_1", "20.04", "aarch64" ], diff --git a/package-system/AWSGameLiftServerSDK/build_package_image.py b/package-system/AWSGameLiftServerSDK/build_package_image.py index 3b699f67..f8ce5434 100644 --- a/package-system/AWSGameLiftServerSDK/build_package_image.py +++ b/package-system/AWSGameLiftServerSDK/build_package_image.py @@ -30,7 +30,7 @@ PACKAGE_LICENSE_FILE: str = "LICENSE_AMAZON_GAMELIFT_SDK.TXT" GAMELIFT_SERVER_SDK_RELEASE_VERSION: str = O3DE_PACKAGE_NAME_PARTS[1] -GAMELIFT_SERVER_SDK_DOWNLOAD_URL: str = "https://gamelift-release.s3-us-west-2.amazonaws.com/GameLift-SDK-Release-5.0.0.zip" +GAMELIFT_SERVER_SDK_DOWNLOAD_URL: str = "https://gamelift-server-sdk-release.s3.us-west-2.amazonaws.com/cpp/GameLift-Cpp-ServerSDK-5.1.1.zip" PACKAGE_BASE_PATH: pathlib.Path = pathlib.Path(os.path.dirname(__file__)) PACKAGE_ROOT_PATH: pathlib.Path = PACKAGE_BASE_PATH.parent @@ -117,8 +117,7 @@ def prepare_working_directory() -> WorkingDirectoryInfo: delete_folder(root_directory) # source and build directory - source_directory: pathlib.Path = \ - root_directory.joinpath(f"GameLift-SDK-Release-{GAMELIFT_SERVER_SDK_RELEASE_VERSION}/GameLift-Cpp-ServerSDK-{GAMELIFT_SERVER_SDK_RELEASE_VERSION}") + source_directory = root_directory build_directory: pathlib.Path = root_directory.joinpath("build") build_directory.mkdir(parents=True) @@ -141,14 +140,8 @@ def download_gamelift_server_sdk(working_directory: WorkingDirectoryInfo) -> Non # unzip sdk contents with zipfile.ZipFile(gamelift_sdk_zip_file, "r") as f: - cpp_serversdk_folder = f"GameLift-SDK-Release-{GAMELIFT_SERVER_SDK_RELEASE_VERSION}/GameLift-Cpp-ServerSDK" unzip_path = working_directory.root_path.resolve() - for file in f.namelist(): - # Only unzip the GameLift-Cpp-ServerSDK folder, which is the only SDK we build - # because other folders inside the zip such as the __MACOSX metadata file structure - # and the Go SDK can exceed the max path on windows - if file.startswith(cpp_serversdk_folder): - f.extract(file, unzip_path) + f.extractall(unzip_path) # get required custom environment for package build def get_custom_build_env(): @@ -169,10 +162,7 @@ def configure_sdk_project(working_directory: WorkingDirectoryInfo, source_folder: str = working_directory.source_path.resolve() build_shared: str = "ON" if lib_type == "Shared" else "OFF" if PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[0]: - # We need to explicitly build using the VS 2019 toolset. If we built using VS 2022 - # then if we try to link against this library from VS 2019 there will be unresolved - # symbols for __std_init_once_link_alternate_names_and_abort and __std_find_trivial_1 - generator: str = "-T v142" + generator: str = '-G "Visual Studio 17 2022" -A x64' elif PACKAGE_PLATFORM in (PACKAGE_PLATFORM_OPTIONS[1], PACKAGE_PLATFORM_OPTIONS[2]): generator: str = "-G \"Unix Makefiles\"" else: @@ -202,12 +192,7 @@ def configure_sdk_project(working_directory: WorkingDirectoryInfo, def build_sdk_project(source_folder: str, build_folder: str, build_type: str) -> None: - if PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[0]: - target: str = "--target ALL_BUILD" - elif PACKAGE_PLATFORM in (PACKAGE_PLATFORM_OPTIONS[1], PACKAGE_PLATFORM_OPTIONS[2]): - target: str = "" - else: - raise Exception(f"Error unsupported platform: {PACKAGE_PLATFORM}") + target = "--target aws-cpp-sdk-gamelift-server" build_cmd: List[str] = ["cmake", f"--build {build_folder}", @@ -263,7 +248,7 @@ def build_gamelift_server_sdk(working_directory: WorkingDirectoryInfo, lib_type: str) -> None: build_folder: pathlib.Path = working_directory.build_path.joinpath(f"{build_type}_{lib_type}").resolve() - print(f"Generating GameLift Server SDK project with {build_type} {lib_type} configuration...") + print(f"Generating GameLift Server SDK project from source ({working_directory.source_path}) with {build_type} {lib_type} configuration...") configure_sdk_project(working_directory, build_folder.resolve(), build_type, lib_type) print(f"Building GameLift Server SDK project with {build_type} {lib_type} configuration...") diff --git a/package-system/AWSGameLiftServerSDK/docker_build_linux.sh b/package-system/AWSGameLiftServerSDK/docker_build_linux.sh index cd17595b..ebd70d5c 100755 --- a/package-system/AWSGameLiftServerSDK/docker_build_linux.sh +++ b/package-system/AWSGameLiftServerSDK/docker_build_linux.sh @@ -22,7 +22,7 @@ fi # Copy the source folder from the read-only $WORKSPACE/temp/src to $WORKSPACE/src # since the build process will write/modify the source path echo "Preparing source folder '$WORKSPACE/src'" -cp -r $WORKSPACE/temp/src/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0 $WORKSPACE/src || (echo "Error copying src from $WORKSPACE/temp" && exit 1) +cp -r $WORKSPACE/temp/src/GameLift-Cpp-ServerSDK-5.1.1/ $WORKSPACE/src || (echo "Error copying src from $WORKSPACE/temp" && exit 1) SRC_PATH=$WORKSPACE/src @@ -108,8 +108,8 @@ cp -r ${BUILD_PATH_ROOT}/Static/prefix/lib ${BUILD_FOLDER}/ cp -r ${BUILD_PATH_ROOT}/Shared/prefix/lib ${BUILD_FOLDER}/bin # Copy the license and notice files -cp $WORKSPACE/temp/src/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/LICENSE_AMAZON_GAMELIFT_SDK.TXT ${BUILD_FOLDER}/ -cp $WORKSPACE/temp/src/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT ${BUILD_FOLDER}/ +cp $WORKSPACE/temp/src/GameLift-Cpp-ServerSDK-5.1.1/LICENSE_AMAZON_GAMELIFT_SDK.TXT ${BUILD_FOLDER}/ +cp $WORKSPACE/temp/src/GameLift-Cpp-ServerSDK-5.1.1/NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT ${BUILD_FOLDER}/ echo "Build Succeeded." diff --git a/package-system/AWSGameLiftServerSDK/test/CMakeLists.txt b/package-system/AWSGameLiftServerSDK/test/CMakeLists.txt index 34e63406..9fea583d 100644 --- a/package-system/AWSGameLiftServerSDK/test/CMakeLists.txt +++ b/package-system/AWSGameLiftServerSDK/test/CMakeLists.txt @@ -43,6 +43,8 @@ PROJECT(test_AWSGameLift VERSION 1.0 LANGUAGES CXX) find_package(OpenSSL) find_package(AWSGameLiftServerSDK) + add_executable(test_AWSGameLift test_AWSGameLiftServer.cpp) + target_link_libraries(test_AWSGameLift PRIVATE 3rdParty::OpenSSL 3rdParty::AWSGameLiftServerSDK) diff --git a/package_build_list_host_linux-aarch64.json b/package_build_list_host_linux-aarch64.json index 7e7f92f6..dc853461 100644 --- a/package_build_list_host_linux-aarch64.json +++ b/package_build_list_host_linux-aarch64.json @@ -6,7 +6,7 @@ "build_from_source": { "assimp-5.2.5-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux-aarch64 --clean", "astc-encoder-3.2-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Linux-aarch64 --clean", - "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean", + "AWSGameLiftServerSDK-5.1.1-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean", "AwsIotDeviceSdkCpp-1.15.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Linux-aarch64 --clean", "AWSNativeSDK-1.11.144-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-aarch64 --clean", "azslc-1.8.15-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Linux-aarch64 --clean", @@ -47,7 +47,7 @@ "build_from_folder": { "assimp-5.2.5-rev1-linux-aarch64": "package-system/assimp/temp/assimp-linux-aarch64", "astc-encoder-3.2-rev3-linux-aarch64": "package-system/astc-encoder/temp/astc-encoder-linux-aarch64", - "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64", + "AWSGameLiftServerSDK-5.1.1-rev1-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64", "AwsIotDeviceSdkCpp-1.15.2-rev1-linux-aarch64": "package-system/AwsIotDeviceSdkCpp/temp/AwsIotDeviceSdkCpp-linux-aarch64", "AWSNativeSDK-1.11.144-rev1-linux-aarch64": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-aarch64", "azslc-1.8.15-rev1-linux-aarch64": "package-system/azslc/temp/azslc-linux-aarch64", diff --git a/package_build_list_host_linux.json b/package_build_list_host_linux.json index 61cf6a38..9c6403d0 100644 --- a/package_build_list_host_linux.json +++ b/package_build_list_host_linux.json @@ -5,8 +5,8 @@ "comment4" : "Note: Build from source occurs before build_from_folder", "build_from_source": { "assimp-5.2.5-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux --package-root ../../package-system --clean", - "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean", - "AWSGameLiftServerSDK-5.0.0-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux --clean", + "AWSGameLiftServerSDK-5.1.1-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux --clean", + "AWSGameLiftServerSDK-5.1.1-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean", "AWSNativeSDK-1.11.144-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux --clean", "AWSNativeSDK-1.11.144-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-aarch64 --clean", "cityhash-1.1-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/cityhash --platform-name Linux --clean", @@ -52,8 +52,8 @@ }, "build_from_folder": { "assimp-5.2.5-rev1-linux": "package-system/assimp-linux", - "AWSGameLiftServerSDK-5.0.0-rev3-linux": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux", - "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64", + "AWSGameLiftServerSDK-5.1.1-rev1-linux": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux", + "AWSGameLiftServerSDK-5.1.1-rev1-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64", "AWSNativeSDK-1.11.144-rev1-linux": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux", "AWSNativeSDK-1.11.144-rev1-linux-aarch64": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-aarch64", "cityhash-1.1-rev1-linux": "package-system/cityhash/temp/cityhash-linux", diff --git a/package_build_list_host_windows.json b/package_build_list_host_windows.json index ee25b5d1..b6bff6eb 100644 --- a/package_build_list_host_windows.json +++ b/package_build_list_host_windows.json @@ -7,7 +7,7 @@ "assimp-5.2.5-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Windows --package-root ../../package-system --clean", "astc-encoder-3.2-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Windows --package-root ../../package-system --clean", "azslc-1.8.15-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Windows --package-root ../../package-system/azslc/temp --clean", - "AWSGameLiftServerSDK-5.0.0-rev2-windows": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name windows", + "AWSGameLiftServerSDK-5.1.1-rev1-windows": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name windows", "AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --build-path c:/Temp/awsiot --platform-name Windows --package-root ../../package-system --clean", "AWSNativeSDK-1.9.50-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean", "AWSNativeSDK-1.11.144-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Windows --package-root ../../package-system --clean", @@ -69,7 +69,7 @@ "assimp-5.2.5-rev1-windows": "package-system/assimp-windows", "astc-encoder-3.2-rev2-windows": "package-system/astc-encoder-windows", "azslc-1.8.15-rev2-windows": "package-system/azslc/temp/azslc-windows", - "AWSGameLiftServerSDK-5.0.0-rev2-windows": "package-system/AWSGameLiftServerSDK-windows", + "AWSGameLiftServerSDK-5.1.1-rev1-windows": "package-system/AWSGameLiftServerSDK-windows", "AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "package-system/AwsIotDeviceSdkCpp-windows", "AWSNativeSDK-1.9.50-rev2-android": "package-system/AWSNativeSDK-android", "AWSNativeSDK-1.11.144-rev1-windows": "package-system/AWSNativeSDK-windows",