Преглед изворни кода

[LYN-4620] Upgrade Mac AWSNativeSDK to 1.9.50 (#47)

* [LYN-4620] Upgrade Mac AWSNativeSDK to 1.9.50
* Add min osx version to get rid off linking warning
* Cleanup find cmake
Vincent Liu пре 3 година
родитељ
комит
d10b1c0f8e

+ 50 - 97
package-system/AWSNativeSDK/FindAWSNativeSDK.cmake.Mac

@@ -24,7 +24,9 @@ endif()
 # AWS Compile Definitions
 set(AWSNATIVESDK_COMPILE_DEFINITIONS AWS_CUSTOM_MEMORY_MANAGEMENT PLATFORM_SUPPORTS_AWS_NATIVE_SDK)
 
-set(AWSNATIVESDK_BUILD_DEPENDENCIES
+find_library(SECURITY_FRAMEWORK Security)
+set(AWSNATIVESDK_BUILD_DEPENDENCIES 
+    ${SECURITY_FRAMEWORK} 
     curl # The one bundled with the aws sdk in 3rdParty doesn't use the right openssl
 )
 
@@ -88,76 +90,69 @@ function(ly_declare_aws_library)
 endfunction()
 
 
-#### Common ####
-if(LY_MONOLITHIC_GAME)
-    ly_declare_aws_library(
-        NAME 
-            Common
-        LIB_FILE 
-            aws-c-common
-    )       
-else()
-    ly_declare_aws_library(
-        NAME 
-            Common
-        LIB_FILE 
-            aws-c-common
-        BUILD_DEPENDENCIES
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common${CMAKE_SHARED_LIBRARY_SUFFIX}
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.0unstable${CMAKE_SHARED_LIBRARY_SUFFIX}
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.1.0.0${CMAKE_SHARED_LIBRARY_SUFFIX}
-        RUNTIME_DEPENDENCIES
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.0unstable${CMAKE_SHARED_LIBRARY_SUFFIX}
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.1.0.0${CMAKE_SHARED_LIBRARY_SUFFIX}
-    )       
-endif()
+#### Core ####
+set(CORE_STATIC_LIBS
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-crt-cpp.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-s3.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-auth.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-mqtt.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-http.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-io.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-checksums.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-compression.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-cal.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.a
+)
 
-#### Checksums ####
-ly_declare_aws_library(
-    NAME 
-        Checksums
-    LIB_FILE 
-        aws-checksums
+set(CORE_SHARED_LIBS
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-crt-cpp.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-s3.0unstable.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-s3.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-s3.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-auth.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-auth.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-mqtt.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-mqtt.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-http.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-http.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-io.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-io.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-checksums.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-checksums.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-compression.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-compression.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-cal.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-cal.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.1.0.0.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.1.dylib
+    ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.dylib
 )
 
-#### EventStream ####
 if(LY_MONOLITHIC_GAME)
     ly_declare_aws_library(
         NAME 
-            EventStream
+            Core
         LIB_FILE 
-            aws-c-event-stream
-        BUILD_DEPENDENCIES 
-            3rdParty::AWSNativeSDK::Checksums
+            aws-cpp-sdk-core
+        BUILD_DEPENDENCIES
+            ${CORE_STATIC_LIBS}
     )
 else()
     ly_declare_aws_library(
         NAME 
-            EventStream
+            Core
         LIB_FILE 
-            aws-c-event-stream
+            aws-cpp-sdk-core
         BUILD_DEPENDENCIES
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream${CMAKE_SHARED_LIBRARY_SUFFIX}
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.0unstable${CMAKE_SHARED_LIBRARY_SUFFIX}
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.1.0.0${CMAKE_SHARED_LIBRARY_SUFFIX}
-            3rdParty::AWSNativeSDK::Checksums
+            ${CORE_SHARED_LIBS}
         RUNTIME_DEPENDENCIES
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.0unstable${CMAKE_SHARED_LIBRARY_SUFFIX}
-            ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.1.0.0${CMAKE_SHARED_LIBRARY_SUFFIX}
+            ${CORE_SHARED_LIBS}
     )
 endif()
 
-#### Core ####
-ly_declare_aws_library(
-    NAME 
-        Core
-    LIB_FILE 
-        aws-cpp-sdk-core
-    BUILD_DEPENDENCIES 
-        3rdParty::AWSNativeSDK::Common
-        3rdParty::AWSNativeSDK::EventStream
-)
-
 #### AccessManagement ####
 ly_declare_aws_library(
     NAME 
@@ -290,46 +285,6 @@ ly_declare_aws_library(
 #########
 ######### Grouping Definitions #########
 #########
-
-
-#### Dependencies ####
-ly_declare_aws_library(
-    NAME 
-        Dependencies
-    BUILD_DEPENDENCIES 
-        3rdParty::AWSNativeSDK::Checksums
-        3rdParty::AWSNativeSDK::Common
-        3rdParty::AWSNativeSDK::EventStream
-)
-
-#### IdentityMetrics ####
-ly_declare_aws_library(
-    NAME 
-        IdentityMetrics
-    BUILD_DEPENDENCIES 
-        3rdParty::AWSNativeSDK::Dependencies
-        3rdParty::AWSNativeSDK::CognitoIdentity
-        3rdParty::AWSNativeSDK::CognitoIdp
-        3rdParty::AWSNativeSDK::Core
-        3rdParty::AWSNativeSDK::IdentityManagement
-        3rdParty::AWSNativeSDK::STS
-        3rdParty::AWSNativeSDK::MobileAnalytics
-)
-
-#### IdentityLambda ####
-ly_declare_aws_library(
-    NAME 
-        IdentityLambda
-    BUILD_DEPENDENCIES 
-        3rdParty::AWSNativeSDK::Dependencies
-        3rdParty::AWSNativeSDK::CognitoIdentity
-        3rdParty::AWSNativeSDK::CognitoIdp
-        3rdParty::AWSNativeSDK::Core
-        3rdParty::AWSNativeSDK::IdentityManagement
-        3rdParty::AWSNativeSDK::Lambda
-        3rdParty::AWSNativeSDK::STS
-)
-
 #### GameLiftClient ####
 ly_declare_aws_library(
     NAME 
@@ -337,7 +292,6 @@ ly_declare_aws_library(
     BUILD_DEPENDENCIES 
         3rdParty::AWSNativeSDK::Core
         3rdParty::AWSNativeSDK::GameLift
-        3rdParty::AWSNativeSDK::Dependencies
 )
 
 #### AWSClientAuth ####
@@ -345,7 +299,7 @@ ly_declare_aws_library(
     NAME 
         AWSClientAuth
     BUILD_DEPENDENCIES 
-        3rdParty::AWSNativeSDK::Dependencies
+        3rdParty::AWSNativeSDK::Core
         3rdParty::AWSNativeSDK::CognitoIdentity
         3rdParty::AWSNativeSDK::CognitoIdp
         3rdParty::AWSNativeSDK::STS
@@ -358,7 +312,6 @@ ly_declare_aws_library(
     NAME 
         AWSCore
     BUILD_DEPENDENCIES 
-        3rdParty::AWSNativeSDK::Dependencies
         3rdParty::AWSNativeSDK::Core
         3rdParty::AWSNativeSDK::DynamoDB
         3rdParty::AWSNativeSDK::Lambda

+ 9 - 3
package-system/AWSNativeSDK/build_AWSNativeSDK_mac.sh

@@ -8,6 +8,10 @@
 
 src_path=temp/src
 bld_path=temp/build
+inst_path=temp/install
+
+echo "Command: rm -rf $inst_path"
+rm -rf $inst_path || (echo "Command: rm -rf $inst_path failed" ; exit 1)
 
 configure_and_build() {
     build_type=$1
@@ -19,19 +23,21 @@ configure_and_build() {
     fi
 
     echo "CMake Configure $build_type $lib_type"
-    CXXFLAGS=-Wno-deprecated-declarations cmake -S "$src_path" -B "$bld_path/${build_type}_${lib_type}" \
+    CFLAGS="-Wno-deprecated-declarations -fPIC" CXXFLAGS="-Wno-deprecated-declarations -fPIC" cmake -S "$src_path" -B "$bld_path/${build_type}_${lib_type}" \
           -G "Xcode" \
           -DTARGET_ARCH=APPLE \
           -DCMAKE_OSX_ARCHITECTURES="x86_64" \
+          -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \
           -DCMAKE_CXX_STANDARD=17 \
+          -DCPP_STANDARD=17 \
           -DENABLE_TESTING=OFF \
           -DENABLE_RTTI=ON \
           -DCUSTOM_MEMORY_MANAGEMENT=ON \
           -DBUILD_ONLY="access-management;cognito-identity;cognito-idp;core;devicefarm;dynamodb;gamelift;identity-management;kinesis;lambda;mobileanalytics;queues;s3;sns;sqs;sts;transfer" \
           -DBUILD_SHARED_LIBS=$build_shared \
           -DCMAKE_BUILD_TYPE=$build_type \
-          -DCMAKE_INSTALL_BINDIR="bin/$build_type" \
-          -DCMAKE_INSTALL_LIBDIR="lib/$build_type" || (echo "CMake Configure $build_type $lib_type failed" ; exit 1)
+          -DCMAKE_INSTALL_BINDIR="bin" \
+          -DCMAKE_INSTALL_LIBDIR="lib" || (echo "CMake Configure $build_type $lib_type failed" ; exit 1)
 
     echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type}"
     cmake --build "$bld_path/${build_type}_${lib_type}" --config $build_type -j 12 || (echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type} failed" ; exit 1)

+ 2 - 1
package-system/AWSNativeSDK/build_config.json

@@ -37,7 +37,8 @@
       },
       "Darwin":{
          "Mac":{
-            "package_version":"1.7.167-rev6",
+            "git_tag":"1.9.50",
+            "package_version":"1.9.50-rev1",
             "cmake_find_source":"FindAWSNativeSDK.cmake.Mac",
             "custom_build_cmd": [
                "./build_AWSNativeSDK_mac.sh"

+ 8 - 14
package-system/AWSNativeSDK/install_AWSNativeSDK_mac.sh

@@ -24,41 +24,35 @@ mkdir -p $out_lib_path/Release
 copy_shared_and_static_libs() {
     local bld_type=$1
     echo "Copying shared .dylib to $out_bin_path/$bld_type"
-    cp -f "$inst_path/lib/$bld_type/"*".dylib" $out_bin_path/$bld_type/ || (echo "Copying shared .dylib to $out_bin_path/$bld_type failed" ; exit 1)
-
-    echo "Copying 3rdParty shared .dylib to $out_bin_path/$bld_type"
-    cp -f "$bld_path/${bld_type}_Shared/.deps/install/lib/"*".dylib" $out_bin_path/$bld_type/ || (echo "Copying 3rdParty shared .dylib to $out_bin_path/$bld_type failed" ; exit 1)
+    cp -f "$inst_path/${bld_type}_Shared/lib/"*".dylib" $out_bin_path/$bld_type/ || (echo "Copying shared .dylib to $out_bin_path/$bld_type failed" ; exit 1)
 
     echo "Copying static .a to $out_lib_path/$bld_type"
-    cp -f "$inst_path/lib/$bld_type/"*".a" $out_lib_path/$bld_type/ || (echo "Copying static .a to $out_lib_path/$bld_type failed" ; exit 1)
-
-    echo "Copying 3rdParty static .a to $out_lib_path/$bld_type"
-    cp -f "$bld_path/${bld_type}_Static/.deps/install/lib/"*".a" $out_lib_path/$bld_type/ || (echo "Copying 3rdParty static .a to $out_lib_path/$bld_type failed" ; exit 1)
+    cp -f "$inst_path/${bld_type}_Static/lib/"*".a" $out_lib_path/$bld_type/ || (echo "Copying static .a to $out_lib_path/$bld_type failed" ; exit 1)
 }
 
 # Debug
 echo "CMake Install Debug Shared to $inst_path"
-cmake --install $bld_path/Debug_Shared --prefix $inst_path --config Debug || (echo "CMake Install Debug Shared to $inst_path failed" ; exit 1)
+cmake --install $bld_path/Debug_Shared --prefix $inst_path/Debug_Shared --config Debug || (echo "CMake Install Debug Shared to $inst_path failed" ; exit 1)
 
 echo "CMake Install Debug Static to $inst_path"
-cmake --install $bld_path/Debug_Static --prefix $inst_path --config Debug || (echo "CMake Install Debug Static to $inst_path failed" ; exit 1)
+cmake --install $bld_path/Debug_Static --prefix $inst_path/Debug_Static --config Debug || (echo "CMake Install Debug Static to $inst_path failed" ; exit 1)
 
 copy_shared_and_static_libs Debug || exit 1
 
 # Release
 echo "CMake Install Release Shared to $inst_path"
-cmake --install $bld_path/Release_Shared --prefix $inst_path --config Release || (echo "CMake Install Release Shared to $inst_path failed" ; exit 1)
+cmake --install $bld_path/Release_Shared --prefix $inst_path/Release_Shared --config Release || (echo "CMake Install Release Shared to $inst_path failed" ; exit 1)
 
 echo "CMake Install Release Static to $inst_path"
-cmake --install $bld_path/Release_Static --prefix $inst_path --config Release || (echo "CMake Install Release Static to $inst_path failed" ; exit 1)
+cmake --install $bld_path/Release_Static --prefix $inst_path/Release_Static --config Release || (echo "CMake Install Release Static to $inst_path failed" ; exit 1)
 
 copy_shared_and_static_libs Release || exit 1
 
 echo "Copying include headers to $out_include_path"
-cp -f -R "$inst_path/include/"* $out_include_path/ || (echo "Copying include headers to $out_include_path failed" ; exit 1)
+cp -f -R "$inst_path/Release_Static/include/"* $out_include_path/ || (echo "Copying include headers to $out_include_path failed" ; exit 1)
 
 echo "Copying LICENSE.txt to $TARGET_INSTALL_ROOT"
 cp -f $src_path/LICENSE.txt $TARGET_INSTALL_ROOT/ || (echo "Copying LICENSE.txt to $TARGET_INSTALL_ROOT failed" ; exit 1)
 
 echo "Custom Install for AWSNativeSDK finished successfully"
-exit 0
+exit 0

+ 2 - 2
package_build_list_host_darwin.json

@@ -4,7 +4,7 @@
     "comment3" : "build_from_folder is package name --> folder containing built image of package",
     "comment4" : "Note:  Build from source occurs before build_from_folder",
     "build_from_source": {
-        "AWSNativeSDK-1.7.167-rev6-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Mac --package-root ../../package-system --clean",
+        "AWSNativeSDK-1.9.50-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Mac --package-root ../../package-system --clean",
         "AWSNativeSDK-1.7.167-rev4-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name iOS --package-root ../../package-system --clean",
         "Lua-5.3.5-rev7-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Mac --package-root ../../package-system --clean",
         "Lua-5.3.5-rev7-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name iOS --package-root ../../package-system --clean",
@@ -49,7 +49,7 @@
         "tiff-4.2.0.15-rev3-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/tiff --platform-name iOS --package-root ../../package-system --clean"
     },
     "build_from_folder": {
-        "AWSNativeSDK-1.7.167-rev6-mac": "package-system/AWSNativeSDK-mac",
+        "AWSNativeSDK-1.9.50-rev1-mac": "package-system/AWSNativeSDK-mac",
         "AWSNativeSDK-1.7.167-rev4-ios": "package-system/AWSNativeSDK-ios",
         "Lua-5.3.5-rev7-mac": "package-system/Lua-mac",
         "Lua-5.3.5-rev7-ios": "package-system/Lua-ios",