FindAWSNativeSDK.cmake.iOS 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. include(CMakeParseArguments)
  8. set(AWSNATIVESDK_PACKAGE_NAME AWSNativeSDK)
  9. set(AWS_BASE_PATH ${CMAKE_CURRENT_LIST_DIR}/${AWSNATIVESDK_PACKAGE_NAME})
  10. # Include Path
  11. set(AWSNATIVESDK_INCLUDE_PATH ${AWS_BASE_PATH}/include)
  12. # Only static libs are supported for this revision
  13. set(AWSNATIVE_SDK_LIB_PATH ${AWS_BASE_PATH}/lib/$<IF:$<CONFIG:Debug>,Debug,Release>)
  14. # AWS Compile Definitions
  15. set(AWSNATIVESDK_COMPILE_DEFINITIONS AWS_CUSTOM_MEMORY_MANAGEMENT PLATFORM_SUPPORTS_AWS_NATIVE_SDK)
  16. find_library(SECURITY_FRAMEWORK Security)
  17. set(AWSNATIVESDK_BUILD_DEPENDENCIES ${SECURITY_FRAMEWORK})
  18. # Helper function to define individual AWSNativeSDK Libraries
  19. function(ly_declare_aws_library)
  20. set(options)
  21. set(oneValueArgs NAME LIB_FILE)
  22. set(multiValueArgs BUILD_DEPENDENCIES)
  23. cmake_parse_arguments(ly_declare_aws_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
  24. set(TARGET_WITH_NAMESPACE "3rdParty::${AWSNATIVESDK_PACKAGE_NAME}::${ly_declare_aws_library_NAME}")
  25. if (NOT TARGET ${TARGET_WITH_NAMESPACE})
  26. add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
  27. ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${AWSNATIVESDK_INCLUDE_PATH})
  28. if (ly_declare_aws_library_LIB_FILE)
  29. target_link_libraries(${TARGET_WITH_NAMESPACE}
  30. INTERFACE
  31. ${AWSNATIVE_SDK_LIB_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}${ly_declare_aws_library_LIB_FILE}${CMAKE_STATIC_LIBRARY_SUFFIX}
  32. ${AWSNATIVESDK_BUILD_DEPENDENCIES}
  33. ${ly_declare_aws_library_BUILD_DEPENDENCIES}
  34. )
  35. elseif (ly_declare_aws_library_BUILD_DEPENDENCIES)
  36. target_link_libraries(${TARGET_WITH_NAMESPACE}
  37. INTERFACE
  38. ${ly_declare_aws_library_BUILD_DEPENDENCIES}
  39. )
  40. endif()
  41. target_link_options(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSNATIVESDK_LINK_OPTIONS})
  42. target_compile_definitions(${TARGET_WITH_NAMESPACE} INTERFACE ${AWSNATIVESDK_COMPILE_DEFINITIONS})
  43. endif()
  44. endfunction()
  45. #### Core ####
  46. set(CORE_STATIC_LIBS
  47. ${AWSNATIVE_SDK_LIB_PATH}/libaws-crt-cpp.a
  48. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-s3.a
  49. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-auth.a
  50. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-mqtt.a
  51. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-http.a
  52. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-event-stream.a
  53. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-io.a
  54. ${AWSNATIVE_SDK_LIB_PATH}/libaws-checksums.a
  55. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-compression.a
  56. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-cal.a
  57. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.a
  58. ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-sdkutils.a
  59. ${AWSNATIVE_SDK_LIB_PATH}/libcurl.a
  60. )
  61. ly_declare_aws_library(
  62. NAME
  63. Core
  64. LIB_FILE
  65. aws-cpp-sdk-core
  66. BUILD_DEPENDENCIES
  67. ${CORE_STATIC_LIBS}
  68. )
  69. #### AccessManagement ####
  70. ly_declare_aws_library(
  71. NAME
  72. AccessManagement
  73. LIB_FILE
  74. aws-cpp-sdk-access-management
  75. BUILD_DEPENDENCIES
  76. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  77. 3rdParty::AWSNativeSDK::Core
  78. )
  79. #### BedrockRuntime ####
  80. ly_declare_aws_library(
  81. NAME
  82. BedrockRuntime
  83. LIB_FILE
  84. aws-cpp-sdk-bedrock-runtime
  85. BUILD_DEPENDENCIES
  86. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  87. 3rdParty::AWSNativeSDK::Core
  88. )
  89. #### CognitoIdentity ####
  90. ly_declare_aws_library(
  91. NAME
  92. CognitoIdentity
  93. LIB_FILE
  94. aws-cpp-sdk-cognito-identity
  95. BUILD_DEPENDENCIES
  96. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  97. 3rdParty::AWSNativeSDK::Core
  98. )
  99. #### CognitoIdp ####
  100. ly_declare_aws_library(
  101. NAME
  102. CognitoIdp
  103. LIB_FILE
  104. aws-cpp-sdk-cognito-idp
  105. BUILD_DEPENDENCIES
  106. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  107. 3rdParty::AWSNativeSDK::Core
  108. )
  109. #### DeviceFarm ####
  110. ly_declare_aws_library(
  111. NAME
  112. DeviceFarm
  113. LIB_FILE
  114. aws-cpp-sdk-devicefarm
  115. BUILD_DEPENDENCIES
  116. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  117. 3rdParty::AWSNativeSDK::Core
  118. )
  119. #### DynamoDB ####
  120. ly_declare_aws_library(
  121. NAME
  122. DynamoDB
  123. LIB_FILE
  124. aws-cpp-sdk-dynamodb
  125. BUILD_DEPENDENCIES
  126. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  127. 3rdParty::AWSNativeSDK::Core
  128. )
  129. #### GameLift ####
  130. ly_declare_aws_library(
  131. NAME
  132. GameLift
  133. LIB_FILE
  134. aws-cpp-sdk-gamelift
  135. BUILD_DEPENDENCIES
  136. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  137. 3rdParty::AWSNativeSDK::Core
  138. )
  139. #### IdentityManagement ####
  140. ly_declare_aws_library(
  141. NAME
  142. IdentityManagement
  143. LIB_FILE
  144. aws-cpp-sdk-identity-management
  145. BUILD_DEPENDENCIES
  146. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  147. 3rdParty::AWSNativeSDK::Core
  148. )
  149. #### Kinesis ####
  150. ly_declare_aws_library(
  151. NAME
  152. Kinesis
  153. LIB_FILE
  154. aws-cpp-sdk-kinesis
  155. BUILD_DEPENDENCIES
  156. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  157. 3rdParty::AWSNativeSDK::Core
  158. )
  159. #### Lambda ####
  160. ly_declare_aws_library(
  161. NAME
  162. Lambda
  163. LIB_FILE
  164. aws-cpp-sdk-lambda
  165. BUILD_DEPENDENCIES
  166. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  167. 3rdParty::AWSNativeSDK::Core
  168. )
  169. #### MobileAnalytics ####
  170. # MobileAnalytics library no longer exists and should be replaced with AWS PinPoint or other equivalent API
  171. #### Queues ####
  172. ly_declare_aws_library(
  173. NAME
  174. Queues
  175. LIB_FILE
  176. aws-cpp-sdk-queues
  177. BUILD_DEPENDENCIES
  178. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  179. 3rdParty::AWSNativeSDK::Core
  180. )
  181. #### S3 ####
  182. ly_declare_aws_library(
  183. NAME
  184. S3
  185. LIB_FILE
  186. aws-cpp-sdk-s3
  187. BUILD_DEPENDENCIES
  188. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  189. 3rdParty::AWSNativeSDK::Core
  190. )
  191. #### SNS ####
  192. ly_declare_aws_library(
  193. NAME
  194. SNS
  195. LIB_FILE
  196. aws-cpp-sdk-sns
  197. BUILD_DEPENDENCIES
  198. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  199. 3rdParty::AWSNativeSDK::Core
  200. )
  201. #### SQS ####
  202. ly_declare_aws_library(
  203. NAME
  204. SQS
  205. LIB_FILE
  206. aws-cpp-sdk-sqs
  207. BUILD_DEPENDENCIES
  208. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  209. 3rdParty::AWSNativeSDK::Core
  210. )
  211. #### STS ####
  212. ly_declare_aws_library(
  213. NAME
  214. STS
  215. LIB_FILE
  216. aws-cpp-sdk-sts
  217. BUILD_DEPENDENCIES
  218. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  219. 3rdParty::AWSNativeSDK::Core
  220. )
  221. #### Transfer ####
  222. ly_declare_aws_library(
  223. NAME
  224. Transfer
  225. LIB_FILE
  226. aws-cpp-sdk-transfer
  227. BUILD_DEPENDENCIES
  228. # Even though AWS Core is a sibling module, make sure it's linked in first because this module depends on it.
  229. 3rdParty::AWSNativeSDK::Core
  230. )
  231. #########
  232. ######### Grouping Definitions #########
  233. #########
  234. #### GameLiftClient ####
  235. ly_declare_aws_library(
  236. NAME
  237. GameLiftClient
  238. BUILD_DEPENDENCIES
  239. 3rdParty::AWSNativeSDK::Core
  240. 3rdParty::AWSNativeSDK::GameLift
  241. )
  242. #### AWSClientAuth ####
  243. ly_declare_aws_library(
  244. NAME
  245. AWSClientAuth
  246. BUILD_DEPENDENCIES
  247. 3rdParty::AWSNativeSDK::Core
  248. 3rdParty::AWSNativeSDK::CognitoIdentity
  249. 3rdParty::AWSNativeSDK::CognitoIdp
  250. 3rdParty::AWSNativeSDK::STS
  251. 3rdParty::AWSNativeSDK::IdentityManagement
  252. )
  253. #### AWSCore ####
  254. ly_declare_aws_library(
  255. NAME
  256. AWSCore
  257. BUILD_DEPENDENCIES
  258. 3rdParty::AWSNativeSDK::Core
  259. 3rdParty::AWSNativeSDK::DynamoDB
  260. 3rdParty::AWSNativeSDK::Lambda
  261. 3rdParty::AWSNativeSDK::S3
  262. )