Ver Fonte

Add gamelift server sdk build script (#93)

* Add gamelift server sdk build script
* Update build script with linux platform
* Tweak windows support as boost build not compatible with VS 2019
* Update by adding linux shared support
Vincent Liu há 3 anos atrás
pai
commit
b273e1115f

+ 0 - 2
package-system/AWSGameLiftServerSDK/.gitignore

@@ -1,2 +0,0 @@
-linux/AWSGameLiftServerSDK/*
-windows/AWSGameLiftServerSDK/*

+ 81 - 0
package-system/AWSGameLiftServerSDK/AWSGameLiftServerSDK-3.4.2-linux.patch

@@ -0,0 +1,81 @@
+diff --git a/cmake/External_boost.cmake b/cmake/External_boost.cmake
+index 6fc990b..17f99d7 100644
+--- a/cmake/External_boost.cmake
++++ b/cmake/External_boost.cmake
+@@ -66,8 +66,14 @@ if(use_bat)
+     BUILD_COMMAND b2 address-model=${am} ${boost_with_args}
+   )
+ else()
++  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
++    set(_build_variant "debug")
++  else()
++    set(_build_variant  "release")
++  endif()
++
+   list(APPEND boost_with_args
+-    "cxxflags=-fPIC")
++    "cflags=-fPIC" "cxxflags=-fPIC" "toolset=clang-12.0" "variant=${_build_variant}")
+   set(boost_cmds
+     CONFIGURE_COMMAND ./bootstrap.sh --prefix=<INSTALL_DIR>
+     BUILD_COMMAND ./b2 address-model=${am} ${boost_with_args}
+diff --git a/cmake/External_sioclient.cmake b/cmake/External_sioclient.cmake
+index 3333da3..6233d98 100644
+--- a/cmake/External_sioclient.cmake
++++ b/cmake/External_sioclient.cmake
+@@ -4,23 +4,41 @@ add_optional_deps(_deps "boost")
+ get_filename_component(_self_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
+ 
+ if(UNIX)
+-    ExternalProject_Add(sioclient
+-      GIT_REPOSITORY https://github.com/socketio/socket.io-client-cpp.git
+-      GIT_TAG 1.6.1
+-      GIT_SUBMODULES
++    ExternalProject_Add(sioclient-src
++        GIT_REPOSITORY https://github.com/socketio/socket.io-client-cpp.git
++        GIT_TAG 1.6.1
++        GIT_SUBMODULES
+         lib/websocketpp
+         lib/rapidjson
+-      SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
+-      INSTALL_DIR "${GameLiftServerSdk_INSTALL_PREFIX}"
+-      PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
+-        "${_self_dir}/sioclient.CMakeLists.txt"
+-        "<SOURCE_DIR>/CMakeLists.txt"
+-      CMAKE_CACHE_ARGS
+-        ${GameLiftServerSdk_DEFAULT_ARGS}
+-        ${GameLiftServerSdk_THIRDPARTYLIBS_ARGS}
+-        "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
+-      DEPENDS
+-        ${_deps}
++        SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
++        UPDATE_COMMAND ""
++        PATCH_COMMAND ""
++        INSTALL_COMMAND ""
++        CONFIGURE_COMMAND ""
++        BUILD_COMMAND ""
++    )
++
++    ExternalProject_Add(sioclient
++        DEPENDS sioclient-src
++        DOWNLOAD_COMMAND ""
++        SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
++        INSTALL_DIR "${GameLiftServerSdk_INSTALL_PREFIX}"
++        PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
++            "${_self_dir}/sioclient.CMakeLists.txt"
++            "<SOURCE_DIR>/CMakeLists.txt"
++        CMAKE_CACHE_ARGS
++            ${GameLiftServerSdk_DEFAULT_ARGS}
++            ${GameLiftServerSdk_THIRDPARTYLIBS_ARGS}
++            "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
++        DEPENDS
++            ${_deps}
++    )
++
++    add_custom_command(
++        TARGET sioclient-src POST_BUILD
++        COMMAND git fetch origin
++        COMMAND git merge 56123c87598f8b1dd471be83ca841ceae07f95ba # keep build dependency consistent
++        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sioclient/lib/websocketpp"
+     )
+ elseif(WIN32)
+     ExternalProject_Add(sioclient-src

+ 35 - 0
package-system/AWSGameLiftServerSDK/AWSGameLiftServerSDK-3.4.2-windows.patch

@@ -0,0 +1,35 @@
+diff --git a/cmake/External_boost.cmake b/cmake/External_boost.cmake
+index 6fc990b..81139b6 100644
+--- a/cmake/External_boost.cmake
++++ b/cmake/External_boost.cmake
+@@ -50,6 +50,8 @@ if(use_bat)
+     set(_toolset "msvc-14.0")
+   elseif(MSVC15)
+     set(_toolset "msvc-14.1")
++  elseif(MSVC16)
++    set(_toolset "msvc-14.2")
+   endif()
+ 
+   if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+diff --git a/cmake/External_sioclient.cmake b/cmake/External_sioclient.cmake
+index 3333da3..f845030 100644
+--- a/cmake/External_sioclient.cmake
++++ b/cmake/External_sioclient.cmake
+@@ -51,11 +51,10 @@ elseif(WIN32)
+        DEPENDS
+          ${_deps}
+      )
+-     if(MSVC14)
+-        add_custom_command(
+-            TARGET sioclient-src POST_BUILD
+-            COMMAND git pull origin master
+-            WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sioclient/lib/websocketpp"
+-        )
+-    endif(MSVC14)
++    add_custom_command(
++        TARGET sioclient-src POST_BUILD
++        COMMAND git fetch origin
++        COMMAND git merge 56123c87598f8b1dd471be83ca841ceae07f95ba # keep build dependency consistent
++        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sioclient/lib/websocketpp"
++    )
+ endif(UNIX)

+ 0 - 20
package-system/AWSGameLiftServerSDK/AWSGameLiftServerSDK_3.4.1.patch

@@ -1,20 +0,0 @@
-diff --git a/cmake/External_boost.cmake b/cmake/External_boost.cmake
-index 6fc990b..4625648 100644
---- a/cmake/External_boost.cmake
-+++ b/cmake/External_boost.cmake
-@@ -66,8 +66,14 @@ if(use_bat)
-     BUILD_COMMAND b2 address-model=${am} ${boost_with_args}
-   )
- else()
-+  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-+    set(_build_variant "debug")
-+  else()
-+    set(_build_variant  "release")
-+  endif()
-+
-   list(APPEND boost_with_args
--    "cxxflags=-fPIC")
-+    "cxxflags=-fPIC" "toolset=clang-6.0" "variant=${_build_variant}")
-   set(boost_cmds
-     CONFIGURE_COMMAND ./bootstrap.sh --prefix=<INSTALL_DIR>
-     BUILD_COMMAND ./b2 address-model=${am} ${boost_with_args}

+ 68 - 0
package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux

@@ -0,0 +1,68 @@
+#
+# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+# its licensors.
+#
+# For complete copyright and license terms please see the LICENSE at the root of this
+# distribution (the "License"). All use of this software is governed by the License,
+# or, if provided, by the license below or the license accompanying this file. Do not
+# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#
+
+set(TARGET_WITH_NAMESPACE "3rdParty::AWSGameLiftServerSDK")
+if (TARGET ${TARGET_WITH_NAMESPACE})
+    return()
+endif()
+
+set(LIB_NAME "AWSGameLiftServerSDK")
+
+set(${LIB_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/include)
+
+if (LY_MONOLITHIC_GAME)
+    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/lib/$<IF:$<CONFIG:Debug>,Debug,Release>)
+
+    set(AWSGAMELIFTSERVERSDK_LIBS
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.a
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libsioclient.a
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_date_time.a
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_random.a
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_system.a
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf.a
+    )
+else()
+    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/bin/$<IF:$<CONFIG:Debug>,Debug,Release>)
+
+    set(AWSGAMELIFTSERVERSDK_LIBS
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.so
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_date_time.so.1.64.0
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_random.so.1.64.0
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_system.so.1.64.0
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf.so.13
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf.so.13.0.0
+    )
+endif()
+
+set(AWSGAMELIFTSERVERSDK_COMPILE_DEFINITIONS
+    AWS_CUSTOM_MEMORY_MANAGEMENT
+    BUILD_GAMELIFT_SERVER
+    PLATFORM_SUPPORTS_AWS_NATIVE_SDK
+    GAMELIFT_USE_STD
+)
+
+# Declare target
+add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
+
+# Add include folder
+ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${LIB_NAME}_INCLUDE_DIR})
+
+if (LY_MONOLITHIC_GAME)
+    target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSGAMELIFTSERVERSDK_LIBS})
+else()
+    target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSGAMELIFTSERVERSDK_LIBS})
+    ly_add_dependencies(${TARGET_WITH_NAMESPACE} ${AWSGAMELIFTSERVERSDK_LIBS})
+endif()
+
+# Set compile definitions
+target_compile_definitions(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSGAMELIFTSERVERSDK_COMPILE_DEFINITIONS})
+
+set(${LIB_NAME}_FOUND True)

+ 2 - 2
package-system/AWSGameLiftServerSDK/windows/FindAWSGameLiftServerSDK.cmake → package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Windows

@@ -22,10 +22,10 @@ set(${LIB_NAME}_LIBS_DIR ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/lib)
 
 if (LY_MONOLITHIC_GAME)
     # Import libs path
-    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${${LIB_NAME}_LIBS_DIR}/intel64/msvc-14.1/$<IF:$<CONFIG:Debug>,Debug,Release>)
+    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${${LIB_NAME}_LIBS_DIR}/$<IF:$<CONFIG:Debug>,Debug,Release>)
 else()
     # Static libs path
-    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${${LIB_NAME}_BIN_DIR}/intel64/msvc-14.1/$<IF:$<CONFIG:Debug>,Debug,Release>)
+    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${${LIB_NAME}_BIN_DIR}/$<IF:$<CONFIG:Debug>,Debug,Release>)
 endif()
 
 set(AWSGAMELIFTSERVERSDK_LIBS

+ 15 - 101
package-system/AWSGameLiftServerSDK/README.md

@@ -3,115 +3,29 @@
 You can find the official GameLift documentation [here](https://aws.amazon.com/documentation/gamelift/).
 
 ## Minimum requirements:
-* Either of the following:  
+* Either of the following:
   * Microsoft Visual Studio 2017 - Windows Build
-  * Clang 6.0 - Linux Build
-* CMake version 3.1 or later
-* Python version 3.6 or later
+  * Clang 12.0 and GCC 9.3 - Linux Build
+* CMake version 3.20 or later
+* Python version 3.7 or later
 * A Git client available on the PATH
 
-## Build the GameLiftServerSdk - Windows
-1. Download the latest [GameLift Server SDK](https://aws.amazon.com/gamelift/getting-started/) 
-   and unzip source `GameLift-Cpp-ServerSDK-{version-number}`
-   
-2. Copy and put `package-system/AWSGameLiftServerSDK/build_and_package.py` and `package-system/AWSGameLiftServerSDK/gamelift-sdk.json` 
-   into `GameLift-Cpp-ServerSDK-{version-number}` directory in step 1
-   
-3. Run the python script `build_and_package.py` under `GameLift-Cpp-ServerSDK-{version-number}` directory, like
+## Prepare steps:
+1. As there is no public repository for server sdk source code, please double check [Amazon GameLift Release Notes](https://docs.aws.amazon.com/gamelift/latest/developerguide/release-notes.html)
+   to confirm server sdk version information
+2. Modify `PACKAGE_VERSION`, `GAMELIFT_SERVER_SDK_RELEASE_VERSION` and `GAMELIFT_SERVER_SDK_DOWNLOAD_URL` to update version 
+   (Refer to `build_package_image.py` script)
+3. [Linux Build] Link Clang compiler for cmake build, for example:
    ```
-   & python build_and_package.py --config gamelift-sdk.json --platform windows --version 3.4.1
+   $ sudo ln -s /usr/lib/llvm-12/bin/clang /usr/bin/clang
    ```
-   
-4. Build package will be located under `GameLift-Cpp-ServerSDK-{version-number}/build/{version-number}` directory
-
-5. Copy and put build package into `package-system/AWSGameLiftServerSDK/windows/AWSGameLiftServerSDK`, for example
-   ``` 
-   - AWSGameLiftServerSDK
-     - bin
-     - include
-     - lib
-     - LICENSE_AMAZON_GAMELIFT_SDK.txt
-     - NOTICE_C++_AMAZON_GAMELIFT_SDK.txt
-   ```
-6. Update `package-system/AWSGameLiftServerSDK/windows/PackageInfo.json` with built version `PackageName`
-
-7. Update `<3p-package-source path>/package_build_list_host_windows.json` with updated `PackageName` in step 6
-
-## Build the GameLiftServerSdk - Linux
-1. Download the latest [GameLift Server SDK](https://aws.amazon.com/gamelift/getting-started/) 
-   and unzip source `GameLift-Cpp-ServerSDK-{version-number}`
-    
-2. Copy and put `package-system/AWSGameLiftServerSDK/build_and_package.py`, `package-system/AWSGameLiftServerSDK/gamelift-sdk.json` 
-   and `package-system/AWSGameLiftServerSDK/AWSGameLiftServerSDK_3.4.1.patch` into `GameLift-Cpp-ServerSDK-{version-number}` directory in step 1
-
-3. Link Clang compiler for cmake build (if `/usr/bin/clang` and `/usr/bin/clang++` symlink exist already, 
-   please remove them first `sudo rm /usr/bin/clang /usr/bin/clang++`)
-   ```
-   $ sudo ln -s /usr/bin/clang-6.0 /usr/bin/clang
-   ```
-   ```
-   $ sudo ln -s /usr/bin/clang++-6.0 /usr/bin/clang++ 
    ```
-
-4. Patch `External_boost.cmake` under `GameLift-Cpp-ServerSDK-{version-number}/cmake`
-   to make sure boost library get build with correct toolset (clang-6.0 for example) and variants
-   * Under `GameLift-Cpp-ServerSDK-{version-number}` directory, run command `git init` to init a local git repository with current directory
-   * Run command `git add .` to stage all existing files
-   * Run command `git commit -m "init commit"` to commit your existing files
-   * Run command `git apply --ignore-space-change --ignore-whitespace AWSGameLiftServerSDK_3.4.1.patch` to apply patch 
-   * Run command `git diff` to check expected changes like
-     ```diff
-          BUILD_COMMAND b2 address-model=${am} ${boost_with_args}
-        )
-      else()
-     +  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-     +    set(_build_variant "debug")
-     +  else()
-     +    set(_build_variant  "release")
-     +  endif()
-     +
-        list(APPEND boost_with_args
-     -    "cxxflags=-fPIC")
-     +    "cxxflags=-fPIC" "toolset=clang-6.0" "variant=${_build_variant}")
-        set(boost_cmds
-          CONFIGURE_COMMAND ./bootstrap.sh --prefix=<INSTALL_DIR>
-          BUILD_COMMAND ./b2 address-model=${am} ${boost_with_args}
-     ```
-
-5. Run the python script `build_and_package.py` under `GameLift-Cpp-ServerSDK-{version-number}` directory, like
-   ```
-   & python3 build_and_package.py --config gamelift-sdk.json --platform linux --version 3.4.1
-   ```
-
-6. Build package will be located under `GameLift-Cpp-ServerSDK-{version-number}/build/{version-number}` directory
-
-7. Copy and put build package into `package-system/AWSGameLiftServerSDK/linux/AWSGameLiftServerSDK`, for example
-   ``` 
-   - AWSGameLiftServerSDK
-     - include
-     - lib
-     - LICENSE_AMAZON_GAMELIFT_SDK.txt
-     - NOTICE_C++_AMAZON_GAMELIFT_SDK.txt
+   $ sudo ln -s /usr/lib/llvm-12/bin/clang++ /usr/bin/clang++ 
    ```
-8. Update `package-system/AWSGameLiftServerSDK/linux/PackageInfo.json` with built version `PackageName`
-
-9. Update `<3p-package-source path>/package_build_list_host_linux.json` with updated `PackageName` in step 6
 
 ## FAQ
-* For windows build, use `--msbuild_path` argument to specify msbuild executable path if msbuild is unrecognized as a valid command, like
-  ```
-  & python build_and_package.py --config gamelift-sdk.json --platform windows --version 3.4.1 --msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"
-  ```
-
+* For windows build, the Amazon GameLift Server SDK depends on an older version of boost, it is recommend to build with `Visual Studio 15 2017`
 * For windows build, if you get error message `The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters`
-  Please move `GameLift-Cpp-ServerSDK-{version-number}` directory out of nested directories and retry.
+  (Refer to [PathTooLongException](https://docs.microsoft.com/en-us/dotnet/api/system.io.pathtoolongexception?view=net-6.0))
+  Please move `3p-package-source` directory to shorter path location and retry.
 
-* This SDK is known to work with these CMake generators:
-  * Visual Studio 15 2017 Win64
-  * Visual Studio 14 2015 Win64
-  * Visual Studio 12 2013 Win64
-  * Visual Studio 11 2012 Win64
-  * Unix MakeFiles
-    
-  By default, we use `vs2017` for windows build and `clang-6.0` for linux build.
-  Please update `gamelift-sdk.json` platform configs: **archs** and **toolchains** if need to change cmake generator.

+ 0 - 290
package-system/AWSGameLiftServerSDK/build_and_package.py

@@ -1,290 +0,0 @@
-#
-# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-# its licensors.
-#
-# For complete copyright and license terms please see the LICENSE at the root of this
-# distribution (the "License"). All use of this software is governed by the License,
-# or, if provided, by the license below or the license accompanying this file. Do not
-# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#
-
-import argparse
-import atexit
-import itertools
-import json
-import os
-import shutil
-import sys
-
-from contextlib import contextmanager
-
-
-def ParseArguments():
-    parser = argparse.ArgumentParser()
-    parser.add_argument('--version', required=True, help='The version number of GameLiftServerSDK, e.g. 3.4.1')
-    parser.add_argument('--platform', required=True, choices=['windows', 'linux'])
-    parser.add_argument('--config', required=True, help='gamelift-sdk.json')
-    parser.add_argument('--msbuild_path', help='msbuild executable path for windows platform')
-
-    return parser.parse_args()
-
-@contextmanager
-def InDirectory(path):
-    prev = os.getcwd()
-    os.chdir(path)
-    yield
-    os.chdir(prev)
-
-class Variant:
-    """
-    Variant class is used to store variants info for cmake build
-    """
-    def __init__(self, platform, arch, toolchain, config, libtype):
-        self.platform = platform
-        self.arch = arch
-        self.toolchain = toolchain
-        self.config = config
-        self.libtype = libtype
-
-    def __str__(self):
-        return f'{self.arch}-{self.toolchain}-{self.config}-{self.libtype}'
-
-    __repr__ = __str__
-
-    def GetPath(self):
-        return str(self)
-
-    def GetGenerateProjectsCommand(self):
-        return f'cmake {self.platform.GetCMakeDefines(self)} {self.platform.GetCMakeGenerator(self)} ..{os.sep}..'
-
-    def GenerateProjects(self):
-        projectPath = self.GetPath()
-        os.makedirs(projectPath, exist_ok=True)
-
-        with InDirectory(projectPath):
-            return os.system(self.GetGenerateProjectsCommand())
-
-        # shouldn't get here, but there is a chance the chdir could fail
-        return 1
-
-    def GetBuildCommand(self):
-        return self.platform.GetBuildCommand(self)
-
-    def Build(self):
-        with InDirectory(self.GetPath()):
-            return os.system(self.GetBuildCommand())
-
-    @property
-    def lib_extension(self):
-        return self.platform.lib_extension
-
-    @property
-    def lib_prefix(self):
-        return 'lib' if self.platform.name == 'Linux' else ''
-
-    @property
-    def shared_lib_extension(self):
-        return self.platform.shared_lib_extension
-
-    @property
-    def lib_config_suffix(self):
-        return 'd' if self.config == 'Debug' and self.platform.name == 'Windows' else ''
-
-class Platform(object):
-    """
-    Platform class is used to store platform related configs for cmake build
-    """
-    def __init__(self, archs, toolchains, configs, libtypes):
-        self.archs = archs
-        self.toolchains = toolchains
-        self.configs = configs
-        self.libtypes = libtypes
-
-    def GetVariants(self):
-        for variant in itertools.product(*[self.archs, self.toolchains, self.configs, self.libtypes]):
-            yield Variant(self, variant[0], variant[1], variant[2], variant[3])
-
-    def GetCMakeGenerator(self, variant):
-        return ''
-
-    def GetCMakeDefines(self, variant):
-        cmakeDefines = ''
-        if variant.libtype == 'Shared':
-            cmakeDefines += '-DBUILD_SHARED_LIBS=1'
-
-        if variant.config == 'Debug':
-            cmakeDefines += ' -DCMAKE_BUILD_TYPE=Debug'
-
-        return cmakeDefines
-
-class WindowsPlatform(Platform):
-    """
-    WindowsPlatform is used to store windows specific platform configs
-    """
-    def __init__(self, archs, toolchains, configs, libtypes):
-        super(WindowsPlatform, self).__init__(archs, toolchains, configs, libtypes)
-        self.name = 'Windows'
-        self.lib_extension = 'lib'
-        self.shared_lib_extension = 'dll'
-        self.msbuild_path = 'msbuild'
-
-    def GetCMakeGenerator(self, variant):
-        return '-G "Visual Studio 15 2017 Win64"'
-
-    def GetBuildCommand(self, variant):
-        return f'{self.msbuild_path} ALL_BUILD.vcxproj /p:Configuration={variant.config}'
-        
-    def SetMSBuildPath(self, msbuild_path):
-        self.msbuild_path = msbuild_path
-
-class LinuxPlatform(Platform):
-    """
-    LinuxPlatform is used to store linux specific platform configs
-    """
-    def __init__(self, archs, toolchains, configs, libtypes):
-        super(LinuxPlatform, self).__init__(archs, toolchains, configs, libtypes)
-        self.name = 'Linux'
-        self.lib_extension = 'a'
-        self.shared_lib_extension = 'so'
-
-    def GetCMakeGenerator(self, variant):
-        return '-G "Unix Makefiles"'
-
-    def GetCMakeDefines(self, variant):
-        # it is necessary until GameLift sdk cmake properly supports clang or passin
-        if variant.toolchain.startswith('clang'):
-            os.environ['CC'] = 'clang'
-            os.environ['CXX'] = 'clang++'
-            os.environ['CXXFLAGS'] = '-fPIC'
-
-        defines = super(LinuxPlatform, self).GetCMakeDefines(variant)
-        return defines
-
-    def GetBuildCommand(self, variant):
-        return 'make'
-
-class Package:
-    """
-    Package class is used to package the expected files defined in gamelift-sdk.json from build process
-    """
-    def __init__(self, outputDir, version, noArchFiles, variantFiles, variantSharedFiles, staticLibOutputDir, sharedLibOutputDir):
-        self.outputDir = outputDir
-        self.version = version
-        self.noArchFiles = noArchFiles
-        self.variantFiles = variantFiles
-        self.variantSharedFiles = variantSharedFiles
-        self.staticLibOutputDir = staticLibOutputDir
-        self.sharedLibOutputDir = sharedLibOutputDir
-        self.variants = []
-
-    def AddVariant(self, variant):
-        self.variants.append(variant)
-
-    def Populate(self):
-        packageDir = os.path.join(self.outputDir, self.version)
-
-        # remove any existing package dir
-        if os.path.isdir(packageDir):
-            shutil.rmtree(packageDir)
-
-        # create package outdir
-        try:
-            os.mkdir(packageDir)
-        except OSError:
-            print(f'[Error] failed to properly create package dir {packageDir}')
-            return
-
-        for fileName in self.noArchFiles:
-            self.SmartCopy(fileName, packageDir)
-
-        # copy built libs by variant
-        for variant in self.variants:
-            self.InstallVariant(variant, packageDir)
-
-    def InstallVariant(self, variant, outdir):
-        libDir = self.sharedLibOutputDir if variant.libtype == 'Shared' else self.staticLibOutputDir
-
-        variantOutdir = os.path.join(outdir, libDir, variant.arch, variant.toolchain, variant.config)
-        os.makedirs(variantOutdir)
-
-        for fileNameFormat in self.variantFiles:
-            fileName = os.path.normpath(os.path.join(self.outputDir, variant.GetPath(), fileNameFormat.format(variant)))
-            self.SmartCopy(fileName, variantOutdir)
-
-        if variant.libtype == 'Shared':
-            for fileNameFormat in self.variantSharedFiles:
-                fileName = os.path.normpath(os.path.join(self.outputDir, variant.GetPath(), fileNameFormat.format(variant)))
-                self.SmartCopy(fileName, variantOutdir)
-
-    def SmartCopy(self, src, dst):
-        if os.path.isdir(src):
-            newdst = os.path.join(dst, os.path.basename(src))
-            print(f'Copying Tree: {src} ==> {newdst}')
-            shutil.copytree(src, newdst)
-        else:
-            print(f'Copying: {src} ==> {dst}')
-            shutil.copy2(src, dst)
-
-def main():
-    args = ParseArguments()
-
-    if not os.path.isfile(args.config):
-        print(f'Invalid config file: {args.config}')
-        exit(1)
-
-    with open(args.config) as configFile:
-        jsonConfig = json.load(configFile)
-
-    outputDir = jsonConfig["OutputDir"]
-    os.makedirs(outputDir, exist_ok=True)
-
-    if args.platform == "windows":
-        platformConfig = jsonConfig["Platforms"]["Windows"]
-        platformFactory = WindowsPlatform
-    else:
-        platformConfig = jsonConfig["Platforms"]["Linux"]
-        platformFactory = LinuxPlatform
-
-    platform = platformFactory(platformConfig["archs"], platformConfig["toolchains"], platformConfig["configs"], platformConfig["libtypes"])
-    if args.msbuild_path:
-        platform.SetMSBuildPath(f'"{args.msbuild_path}"')
-
-    package = Package(outputDir, args.version, jsonConfig["NoArchFiles"], jsonConfig["VariantFiles"], jsonConfig["VariantSharedFiles"],
-        jsonConfig["StaticLibOutputDir"], jsonConfig["SharedLibOutputDir"])
-    projectIssues = []
-    buildIssues = []
-
-    # Create projects and build
-    with InDirectory(outputDir):
-        for variant in platform.GetVariants():
-            print()
-            print(f'########### {variant} ###########')
-
-            print(f'Running: {variant.GetGenerateProjectsCommand()}')
-            projectResult = variant.GenerateProjects()
-            if projectResult != 0:
-                projectIssues.append(variant)
-            else:
-                print(f'Running: {variant.GetBuildCommand()}')
-                buildResult = variant.Build()
-                if buildResult != 0:
-                   buildIssues.append(variant)
-
-            package.AddVariant(variant)
-
-        print()
-        print('########### Report ###########')
-        print(f'Project failures: {projectIssues}')
-        print(f'Build failures: {buildIssues}')
-
-    print()
-    if len(projectIssues) == 0 and len(buildIssues) == 0:
-        package.Populate()
-        print(f'Package "{args.version}" created in directory "{outputDir}"')
-    else:
-        print('Skipping package creation due to build errors.')
-
-if __name__ == '__main__':
-    main()
-

+ 308 - 0
package-system/AWSGameLiftServerSDK/build_package_image.py

@@ -0,0 +1,308 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+import argparse
+import glob
+import json
+import os
+import pathlib
+import subprocess
+import shutil
+import urllib.request
+import zipfile
+from typing import List
+
+PACKAGE_NAME: str = "AWSGameLiftServerSDK"
+PACKAGE_VERSION: str = "3.4.2-rev1"
+PACKAGE_PLATFORM: str = ""
+PACKAGE_URL: str = "https://aws.amazon.com/documentation/gamelift/"
+PACKAGE_LICENSE: str = "Apache-2.0"
+PACKAGE_LICENSE_FILE: str = "LICENSE_AMAZON_GAMELIFT_SDK.TXT"
+
+GAMELIFT_SERVER_SDK_RELEASE_VERSION: str = "4.0.2"
+GAMELIFT_SERVER_SDK_DOWNLOAD_URL: str = "https://gamelift-release.s3-us-west-2.amazonaws.com/GameLift_06_03_2021.zip"
+
+PACKAGE_BASE_PATH: pathlib.Path = pathlib.Path(os.path.dirname(__file__))
+PACKAGE_ROOT_PATH: pathlib.Path = PACKAGE_BASE_PATH.parent
+PACKAGE_BUILD_TYPES: List[str] = ["Debug", "Release"]
+PACKAGE_LIB_TYPES: List[str] = ["Shared", "Static"]
+PACKAGE_PLATFORM_OPTIONS: List[str] = ["windows", "linux"]
+
+# utils
+class WorkingDirectoryInfo(object):
+    def __init__(self, root_path: pathlib.Path,
+                 source_path: pathlib.Path,
+                 build_path: pathlib.Path,
+                 output_path: pathlib.Path,
+                 libs_output_path: pathlib.Path) -> None:
+        self.root_path = root_path
+        self.source_path = source_path
+        self.build_path = build_path
+        self.output_path = output_path
+        self.libs_output_path = libs_output_path
+
+def subp_args(args) -> str:
+    arg_string = " ".join([arg for arg in args])
+    print(f"Command: {arg_string}")
+    return arg_string
+
+def delete_folder(folder: pathlib.Path) -> None:
+    shutil.rmtree(folder.resolve())
+
+def copy_file_to_destination(file: str, destination: str) -> None:
+    print(f"Copying {file} to {destination}")
+    shutil.copy2(file, destination)
+
+# collect package build required information, like platform
+def collect_package_info() -> None:
+    parser = argparse.ArgumentParser()
+    parser.add_argument(
+        '--platform-name',
+        required=True,
+        choices=PACKAGE_PLATFORM_OPTIONS
+    )
+    
+    args = parser.parse_args()
+    global PACKAGE_PLATFORM
+    PACKAGE_PLATFORM = args.platform_name
+
+# prepare working directories for package build
+def prepare_working_directory() -> WorkingDirectoryInfo:
+    # root directory
+    root_directory: pathlib.Path = PACKAGE_BASE_PATH.joinpath("temp")
+    if root_directory.is_dir():
+        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-{PACKAGE_VERSION.split('-')[0]}")
+    build_directory: pathlib.Path = root_directory.joinpath("build")
+    build_directory.mkdir(parents=True)
+    
+    # build output and libs output directory
+    build_output_directory: pathlib.Path = PACKAGE_ROOT_PATH.joinpath(f"{PACKAGE_NAME}-{PACKAGE_PLATFORM}")
+    if build_output_directory.is_dir():
+        delete_folder(build_output_directory)
+    
+    build_libs_output_directory: pathlib.Path = build_output_directory.joinpath(f"{PACKAGE_NAME}")
+    build_libs_output_directory.mkdir(parents=True)
+    
+    return WorkingDirectoryInfo(root_directory, source_directory, build_directory, build_output_directory, build_libs_output_directory)
+
+# download gamelift server server sdk source code for package build
+def download_gamelift_server_sdk(working_directory: WorkingDirectoryInfo) -> None:
+    # download sdk from url
+    gamelift_sdk_zip_file: str = str(working_directory.root_path.joinpath("gamelift_server_sdk.zip").resolve())
+    with urllib.request.urlopen(GAMELIFT_SERVER_SDK_DOWNLOAD_URL) as response, open(gamelift_sdk_zip_file, 'wb') as out_file:
+        shutil.copyfileobj(response, out_file)
+    
+    # unzip sdk contents
+    with zipfile.ZipFile(gamelift_sdk_zip_file, "r") as f:
+        f.extractall(working_directory.root_path.resolve())
+
+# apply required patch file to support package build
+def apply_patch_on_sdk_source(working_directory: WorkingDirectoryInfo) -> None:
+    patch_file: str = str(PACKAGE_BASE_PATH.joinpath(f"{PACKAGE_NAME}-{PACKAGE_VERSION.split('-')[0]}-{PACKAGE_PLATFORM}.patch").resolve())
+    source_folder: str = str(working_directory.source_path.resolve())
+    git_result = subprocess.run(subp_args(["git","init"]), 
+                                shell=True,
+                                capture_output=True,
+                                cwd=source_folder)
+    if git_result.returncode != 0:
+        raise Exception(f"Error git init sdk source: {git_result.stderr.decode()}")
+    git_result = subprocess.run(subp_args(["git","add","."]), 
+                                shell=True,
+                                capture_output=True,
+                                cwd=source_folder)
+    if git_result.returncode != 0:
+        raise Exception(f"Error git add sdk source: {git_result.stderr.decode()}")
+    git_result = subprocess.run(subp_args(["git","commit","-m","temp"]),
+                                shell=True,
+                                capture_output=True,
+                                cwd=source_folder)
+    if git_result.returncode != 0:
+        raise Exception(f"Error git commit sdk source: {git_result.stderr.decode()}")
+    git_result = subprocess.run(subp_args(["git","apply", "--ignore-space-change", "--ignore-whitespace", f"{patch_file}"]),
+                                shell=True,
+                                capture_output=True,
+                                cwd=source_folder)
+    if git_result.returncode != 0:
+        raise Exception(f"Error git apply patch sdk source: {git_result.stderr.decode()}")
+
+# get required custom environment for package build
+def get_custom_build_env():
+    if PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[1]:
+        custom_env = os.environ.copy()
+        custom_env["CC"] = "clang"
+        custom_env["CXX"] = "clang++"
+        custom_env["CFLAGS"] = "-fPIC"
+        custom_env["CXXFLAGS"] = "-fPIC"
+        return custom_env
+    return None
+
+# configure gamelift server sdk project
+def configure_sdk_project(source_folder: str,
+                          build_folder: str,
+                          build_type: str,
+                          lib_type: str) -> None:
+    build_shared: str = "ON" if lib_type == "Shared" else "OFF"
+    if PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[0]:
+        generator: str = "-G \"Visual Studio 15 2017\" -A x64"
+    elif PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[1]:
+        generator: str = "-G \"Unix Makefiles\""
+    else:
+        raise Exception(f"Error unsupported platform: {PACKAGE_PLATFORM}")
+        
+    configure_cmd: List[str] = [f"cmake {generator} -S .",
+                                f"-B {build_folder}",
+                                f"-DBUILD_SHARED_LIBS={build_shared}",
+                                f"-DCMAKE_BUILD_TYPE={build_type}"]
+    configure_result = subprocess.run(subp_args(configure_cmd),
+                                      shell=True,
+                                      capture_output=True,
+                                      cwd=source_folder,
+                                      env=get_custom_build_env())
+    if configure_result.returncode != 0:
+        raise Exception(f"Error generating project: {configure_result.stderr.decode()}")
+
+# build gamelift server sdk project
+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 == PACKAGE_PLATFORM_OPTIONS[1]:
+        target: str = ""
+    else:
+        raise Exception(f"Error unsupported platform: {PACKAGE_PLATFORM}")
+    
+    build_cmd: List[str] = ["cmake",
+                            f"--build {build_folder}",
+                            f"--config {build_type}",
+                            f"{target} -j"]
+    build_result = subprocess.run(subp_args(build_cmd),
+                                  shell=True,
+                                  capture_output=True,
+                                  cwd=source_folder,
+                                  env=get_custom_build_env())
+    if build_result.returncode != 0:
+        raise Exception(f"Error building project: {build_result.stderr.decode()}")
+
+# copy all built gamelift server sdk libs into expected output folder
+def copy_sdk_libs(libs_output_path: pathlib.Path,
+                  build_path: pathlib.Path,
+                  build_type: str,
+                  lib_type: str) -> None:
+    if lib_type == PACKAGE_LIB_TYPES[0]:
+        destination: pathlib.Path = libs_output_path.joinpath(f"bin/{build_type}")
+    else:
+        destination: pathlib.Path = libs_output_path.joinpath(f"lib/{build_type}")
+    destination.mkdir(parents=True)
+    
+    install_folder: pathlib.Path = build_path.joinpath("prefix")
+    if PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[0]:
+        shared_libs_pattern: str = str(install_folder.joinpath("bin/*.dll"))
+        static_libs_pattern: str = str(install_folder.joinpath("lib/*.lib"))
+        
+        # for windows, it always requires .lib file, .dll file is only required for shared libs
+        if lib_type == PACKAGE_LIB_TYPES[0]:
+            for file in glob.glob(shared_libs_pattern):
+                copy_file_to_destination(file, str(destination.resolve()))
+
+        for file in glob.glob(static_libs_pattern):
+            copy_file_to_destination(file, str(destination.resolve()))
+    elif PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[1]:
+        shared_libs_pattern: str = str(install_folder.joinpath("lib/*.so*"))
+        static_libs_pattern: str = str(install_folder.joinpath("lib/*.a"))
+        
+        # for linux, it requires .a file for static libs and .so file for shared libs
+        if lib_type == PACKAGE_LIB_TYPES[0]:
+            for file in glob.glob(shared_libs_pattern):
+                copy_file_to_destination(file, str(destination.resolve()))
+        else:
+            for file in glob.glob(static_libs_pattern):
+                copy_file_to_destination(file, str(destination.resolve()))
+    else:
+        raise Exception(f"Error unsupported platform: {PACKAGE_PLATFORM}")
+
+def build_gamelift_server_sdk(working_directory: WorkingDirectoryInfo,
+                              build_type: str,
+                              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...")
+    configure_sdk_project(working_directory.source_path.resolve(), build_folder.resolve(), build_type, lib_type)
+    
+    print(f"Building GameLift Server SDK project with {build_type} {lib_type} configuration...")
+    build_sdk_project(working_directory.source_path.resolve(), build_folder.resolve(), build_type)
+    
+    print(f"Copying {build_type} {lib_type} built sdk libs into output folder...")
+    copy_sdk_libs(working_directory.libs_output_path, build_folder, build_type, lib_type)
+
+# generate required information for package, like name, url, and license
+def generate_packageInfo(working_directory: WorkingDirectoryInfo) -> None:
+    settings={
+        'PackageName': f'{PACKAGE_NAME}-{PACKAGE_VERSION}-{PACKAGE_PLATFORM}',
+        "URL"         : f'{PACKAGE_URL}',
+        "License"     : f'{PACKAGE_LICENSE}',
+        'LicenseFile': f'{PACKAGE_NAME}/{PACKAGE_LICENSE_FILE}'
+    }
+    package_file: str = str(working_directory.output_path.joinpath("PackageInfo.json").resolve())
+    with open(package_file, 'w') as fh:
+        json.dump(settings, fh, indent=4)
+
+# generate required cmake file which is used to find package libs
+def generate_cmake_file(working_directory: WorkingDirectoryInfo) -> None:
+    cmake_file_source: pathlib.Path = PACKAGE_BASE_PATH.joinpath(f"Find{PACKAGE_NAME}.cmake.{PACKAGE_PLATFORM.title()}")
+    if cmake_file_source.is_file():
+        find_cmake_content = cmake_file_source.read_text("UTF-8", "ignore")
+
+        target_cmake_file: pathlib.Path = working_directory.output_path.joinpath(f"Find{PACKAGE_NAME}.cmake")
+        target_cmake_file.write_text(find_cmake_content)
+    else:
+        raise Exception(f"Error finding cmake source file: {str(cmake_file_source.resolve())}")
+
+
+if __name__ == '__main__':
+    try:
+        print("Collecting package build info for GameLift Server SDK...")
+        collect_package_info()
+        
+        print("Prepare working directory...")
+        working_directory: WorkingDirectoryInfo = prepare_working_directory()
+        
+        print(f"Downloading GameLift Server SDK from {GAMELIFT_SERVER_SDK_DOWNLOAD_URL}...")
+        download_gamelift_server_sdk(working_directory)
+        
+        print("Initializing and applying patch to GameLift Server SDK source....")
+        apply_patch_on_sdk_source(working_directory)
+        
+        # build sdk with different configurations
+        for build_type in PACKAGE_BUILD_TYPES:
+                for lib_type in PACKAGE_LIB_TYPES:
+                    build_gamelift_server_sdk(working_directory, build_type, lib_type)
+        
+        print("Copying include and license files into output directory...")
+        shutil.copytree(working_directory.source_path.joinpath("gamelift-server-sdk/include").resolve(),
+                        working_directory.libs_output_path.joinpath("include").resolve())
+        copy_file_to_destination(str(working_directory.source_path.joinpath(PACKAGE_LICENSE_FILE).resolve()),
+                                 str(working_directory.libs_output_path.resolve()))
+        copy_file_to_destination(str(working_directory.source_path.joinpath("NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT").resolve()),
+                                 str(working_directory.libs_output_path.resolve()))
+        
+        print("Generating package info into output directory...")
+        generate_packageInfo(working_directory)
+        
+        print("Generating cmake file into output directory...")
+        generate_cmake_file(working_directory)
+        exit(0)
+    except Exception as e:
+        print(e)
+        exit(1)

+ 0 - 46
package-system/AWSGameLiftServerSDK/gamelift-sdk.json

@@ -1,46 +0,0 @@
-{
-    "OutputDir": "build",
-    "StaticLibOutputDir": "lib",
-    "SharedLibOutputDir": "bin",
-
-    "Platforms":
-    {
-        "Windows":
-        {
-            "archs"     : ["intel64"],
-            "toolchains": ["msvc-14.1"],
-            "configs"   : ["Debug", "Release"],
-            "libtypes"  : ["Shared", "Static"]
-        },
-
-        "Linux":
-        {
-            "archs"     : ["intel64"],
-            "toolchains": ["clang-6.0"],
-            "configs"   : ["Debug", "Release"],
-            "libtypes"  : ["Static"]
-        }
-    },
-
-    "NoArchFiles":
-    [
-        "gamelift-server-sdk/include",
-        "NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT",
-        "LICENSE_AMAZON_GAMELIFT_SDK.TXT"
-    ],
-
-    "VariantFiles":
-    [
-        "prefix/lib/libboost_date_time.{0.lib_extension}",
-        "prefix/lib/libboost_random.{0.lib_extension}",
-        "prefix/lib/libboost_system.{0.lib_extension}",
-        "prefix/lib/libprotobuf{0.lib_config_suffix}.{0.lib_extension}",
-        "prefix/lib/{0.lib_prefix}sioclient.{0.lib_extension}",
-        "prefix/lib/{0.lib_prefix}aws-cpp-sdk-gamelift-server.{0.lib_extension}"
-    ], 
-
-    "VariantSharedFiles":
-    [
-        "prefix/bin/{0.lib_prefix}aws-cpp-sdk-gamelift-server.{0.shared_lib_extension}"
-    ]
-}

+ 0 - 57
package-system/AWSGameLiftServerSDK/linux/FindAWSGameLiftServerSDK.cmake

@@ -1,57 +0,0 @@
-#
-# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-# its licensors.
-#
-# For complete copyright and license terms please see the LICENSE at the root of this
-# distribution (the "License"). All use of this software is governed by the License,
-# or, if provided, by the license below or the license accompanying this file. Do not
-# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#
-
-set(TARGET_WITH_NAMESPACE "3rdParty::AWSGameLiftServerSDK")
-if (TARGET ${TARGET_WITH_NAMESPACE})
-    return()
-endif()
-
-set(LIB_NAME "AWSGameLiftServerSDK")
-
-set(${LIB_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/include)
-set(${LIB_NAME}_LIBS_DIR ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/lib)
-
-set(AWSGAMELIFTSERVERSDK_LIB_PATH ${${LIB_NAME}_LIBS_DIR}/intel64/clang-6.0/$<IF:$<CONFIG:Debug>,Debug,Release>)
-
-set(AWSGAMELIFTSERVERSDK_LIBS
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.a
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libsioclient.a
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_date_time.a
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_random.a
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_system.a
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf.a
-)
-
-set(AWSGAMELIFTSERVERSDK_COMPILE_DEFINITIONS
-    AWS_CUSTOM_MEMORY_MANAGEMENT
-    BUILD_GAMELIFT_SERVER
-    PLATFORM_SUPPORTS_AWS_NATIVE_SDK
-    GAMELIFT_USE_STD
-)
-
-if (NOT LY_MONOLITHIC_GAME)
-    # Add 'USE_IMPORT_EXPORT' for external linkage
-    LIST(APPEND AWSGAMELIFTSERVERSDK_COMPILE_DEFINITIONS USE_IMPORT_EXPORT)
-endif()
-
-# Declare target
-add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
-
-# Add include folder
-ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${LIB_NAME}_INCLUDE_DIR})
-
-# Add link libs
-target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSGAMELIFTSERVERSDK_LIBS})
-
-# Set compile definitions
-target_compile_definitions(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSGAMELIFTSERVERSDK_COMPILE_DEFINITIONS})
-
-set(${LIB_NAME}_FOUND True)

+ 0 - 6
package-system/AWSGameLiftServerSDK/linux/PackageInfo.json

@@ -1,6 +0,0 @@
-{
-    "PackageName" : "AWSGameLiftServerSDK-3.4.1-rev1-linux",
-    "URL"         : "https://aws.amazon.com/documentation/gamelift/",
-    "License"     : "Apache-2.0",
-    "LicenseFile" : "AWSGameLiftServerSDK/LICENSE_AMAZON_GAMELIFT_SDK.TXT"
-}

+ 0 - 6
package-system/AWSGameLiftServerSDK/windows/PackageInfo.json

@@ -1,6 +0,0 @@
-{
-    "PackageName" : "AWSGameLiftServerSDK-3.4.1-rev1-windows",
-    "URL"         : "https://aws.amazon.com/documentation/gamelift/",
-    "License"     : "Apache-2.0",
-    "LicenseFile" : "AWSGameLiftServerSDK/LICENSE_AMAZON_GAMELIFT_SDK.TXT"
-}

+ 2 - 1
package_build_list_host_linux.json

@@ -5,6 +5,7 @@
     "comment4" : "Note:  Build from source occurs before build_from_folder",
     "build_from_source": {
         "assimp-5.1.6-rev1-linux":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux --package-root ../../package-system --clean",
+        "AWSGameLiftServerSDK-3.4.2-rev1-linux": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name linux",
         "AWSNativeSDK-1.9.50-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux --package-root ../../package-system --clean",
         "Lua-5.4.4-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Linux --package-root ../../package-system/Lua/temp --clean",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Linux --package-root ../../package-system --clean",
@@ -39,7 +40,7 @@
     },
     "build_from_folder": {
         "assimp-5.1.6-rev1-linux": "package-system/assimp-linux",
-        "AWSGameLiftServerSDK-3.4.1-rev1-linux": "package-system/AWSGameLiftServerSDK/linux",
+        "AWSGameLiftServerSDK-3.4.2-rev1-linux": "package-system/AWSGameLiftServerSDK-linux",
         "AWSNativeSDK-1.9.50-rev1-linux": "package-system/AWSNativeSDK-linux",
         "Lua-5.4.4-rev1-linux": "package-system/Lua/temp/Lua-linux",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "package-system/AwsIotDeviceSdkCpp-linux",

+ 2 - 1
package_build_list_host_windows.json

@@ -5,6 +5,7 @@
     "comment4" : "Note:  Build from source occurs before build_from_folder",
     "build_from_source": {
         "assimp-5.1.6-rev1-windows":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Windows --package-root ../../package-system --clean",
+        "AWSGameLiftServerSDK-3.4.2-rev1-windows": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name windows",
         "AWSNativeSDK-1.9.50-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Windows --package-root ../../package-system --clean",
         "AWSNativeSDK-1.9.50-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean",
         "Blast-v1.1.7_rc2-9-geb169fe-rev2-windows": "package-system/Blast/build_package_image.py --platform-name windows",
@@ -55,7 +56,7 @@
   "build_from_folder": {
     "assimp-5.1.6-rev1-windows": "package-system/assimp-windows",
     "astc-encoder-3.2-rev2-windows": "package-system/astc-encoder-windows",
-    "AWSGameLiftServerSDK-3.4.1-rev1-windows": "package-system/AWSGameLiftServerSDK/windows",
+    "AWSGameLiftServerSDK-3.4.2-rev1-windows": "package-system/AWSGameLiftServerSDK-windows",
     "AWSNativeSDK-1.9.50-rev2-windows": "package-system/AWSNativeSDK-windows",
     "AWSNativeSDK-1.9.50-rev1-android": "package-system/AWSNativeSDK-android",
     "Blast-v1.1.7_rc2-9-geb169fe-rev1-windows": "package-system/Blast-windows",