CMakeLists.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. #
  8. ly_add_target(
  9. NAME ${gem_name}.Static STATIC
  10. NAMESPACE Gem
  11. FILES_CMAKE
  12. awsmetrics_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PUBLIC
  15. Include
  16. PRIVATE
  17. Source
  18. BUILD_DEPENDENCIES
  19. PRIVATE
  20. AZ::AzCore
  21. AZ::AzFramework
  22. PUBLIC
  23. Gem::AWSCore
  24. 3rdParty::AWSNativeSDK::Core
  25. )
  26. ly_add_target(
  27. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  28. NAMESPACE Gem
  29. FILES_CMAKE
  30. awsmetrics_shared_files.cmake
  31. INCLUDE_DIRECTORIES
  32. PUBLIC
  33. Include
  34. PRIVATE
  35. Source
  36. BUILD_DEPENDENCIES
  37. PRIVATE
  38. AZ::AzCore
  39. AZ::AzFramework
  40. Gem::${gem_name}.Static
  41. )
  42. # Inject the gem name into the Module source file
  43. ly_add_source_properties(
  44. SOURCES
  45. Source/AWSMetricsModule.cpp
  46. PROPERTY COMPILE_DEFINITIONS
  47. VALUES
  48. O3DE_GEM_NAME=${gem_name}
  49. O3DE_GEM_VERSION=${gem_version})
  50. # Load the "Gem::${gem_name}" module in all types of applications.
  51. ly_create_alias(
  52. NAME ${gem_name}.Servers
  53. NAMESPACE Gem
  54. TARGETS
  55. Gem::AWSCore.Servers
  56. Gem::${gem_name}
  57. )
  58. ly_create_alias(
  59. NAME ${gem_name}.Clients
  60. NAMESPACE Gem
  61. TARGETS
  62. Gem::AWSCore.Clients
  63. Gem::${gem_name}
  64. )
  65. ly_create_alias(
  66. NAME ${gem_name}.Unified
  67. NAMESPACE Gem
  68. TARGETS
  69. Gem::AWSCore.Unified
  70. Gem::${gem_name}
  71. )
  72. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  73. ly_create_alias(
  74. NAME ${gem_name}.Tools
  75. NAMESPACE Gem
  76. TARGETS
  77. Gem::AWSCore.Tools
  78. Gem::${gem_name}.Editor
  79. )
  80. ly_create_alias(
  81. NAME ${gem_name}.Builders
  82. NAMESPACE Gem
  83. TARGETS
  84. Gem::AWSCore.Builders
  85. Gem::${gem_name}
  86. )
  87. endif()
  88. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  89. ly_add_target(
  90. NAME ${gem_name}.Editor ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  91. NAMESPACE Gem
  92. FILES_CMAKE
  93. awsmetrics_editor_files.cmake
  94. awsmetrics_shared_files.cmake
  95. INCLUDE_DIRECTORIES
  96. PUBLIC
  97. Include
  98. PRIVATE
  99. Source
  100. COMPILE_DEFINITIONS
  101. PRIVATE
  102. AWS_METRICS_EDITOR
  103. BUILD_DEPENDENCIES
  104. PRIVATE
  105. AZ::AzCore
  106. AZ::AzFramework
  107. AZ::AzToolsFramework
  108. Gem::AWSCore
  109. 3rdParty::AWSNativeSDK::Core
  110. RUNTIME_DEPENDENCIES
  111. Gem::${gem_name}
  112. )
  113. endif()
  114. ################################################################################
  115. # Tests
  116. ################################################################################
  117. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  118. ly_add_target(
  119. NAME ${gem_name}.Tests MODULE
  120. NAMESPACE Gem
  121. FILES_CMAKE
  122. awsmetrics_tests_files.cmake
  123. INCLUDE_DIRECTORIES
  124. PRIVATE
  125. Include
  126. Source
  127. Tests
  128. BUILD_DEPENDENCIES
  129. PRIVATE
  130. AZ::AzTest
  131. AZ::AzCore
  132. AZ::AzFramework
  133. Gem::${gem_name}.Static
  134. RUNTIME_DEPENDENCIES
  135. Gem::AWSCore
  136. )
  137. ly_add_googletest(
  138. NAME Gem::${gem_name}.Tests
  139. LABELS REQUIRES_tiaf
  140. )
  141. endif()