CMakeLists.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. if (NOT PAL_TRAIT_BUILD_SERVER_SUPPORTED)
  9. return()
  10. endif()
  11. o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path)
  12. o3de_pal_dir(pal_source_dir "${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}" "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  13. include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  14. if (NOT PAL_TRAIT_AWSGAMELIFTSERVER_SUPPORTED)
  15. return()
  16. endif()
  17. ly_add_target(
  18. NAME ${gem_name}.Server.Static STATIC
  19. NAMESPACE Gem
  20. FILES_CMAKE
  21. awsgamelift_server_files.cmake
  22. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  23. INCLUDE_DIRECTORIES
  24. PUBLIC
  25. ../AWSGameLiftCommon/Include
  26. Include
  27. PRIVATE
  28. ../AWSGameLiftCommon/Source
  29. Source
  30. BUILD_DEPENDENCIES
  31. PRIVATE
  32. AZ::AzCore
  33. Gem::Multiplayer.Server.Static
  34. 3rdParty::AWSGameLiftServerSDK
  35. )
  36. ly_add_target(
  37. NAME ${gem_name}.Servers ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  38. NAMESPACE Gem
  39. FILES_CMAKE
  40. awsgamelift_server_shared_files.cmake
  41. INCLUDE_DIRECTORIES
  42. PRIVATE
  43. Source
  44. BUILD_DEPENDENCIES
  45. PUBLIC
  46. AZ::AzCore
  47. Gem::${gem_name}.Server.Static
  48. 3rdParty::AWSGameLiftServerSDK
  49. )
  50. # Inject the gem name into the Module source file
  51. ly_add_source_properties(
  52. SOURCES
  53. Source/AWSGameLiftServerModule.cpp
  54. PROPERTY COMPILE_DEFINITIONS
  55. VALUES
  56. O3DE_GEM_NAME=${gem_name}
  57. O3DE_GEM_VERSION=${gem_version})
  58. ################################################################################
  59. # Tests
  60. ################################################################################
  61. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  62. ly_add_target(
  63. NAME ${gem_name}.Server.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  64. NAMESPACE Gem
  65. FILES_CMAKE
  66. awsgamelift_server_tests_files.cmake
  67. INCLUDE_DIRECTORIES
  68. PRIVATE
  69. ../AWSGameLiftCommon/Include
  70. ../AWSGameLiftCommon/Source
  71. Tests
  72. Source
  73. BUILD_DEPENDENCIES
  74. PRIVATE
  75. AZ::AzCore
  76. AZ::AzTest
  77. Gem::Multiplayer.Server.Static
  78. Gem::${gem_name}.Server.Static
  79. 3rdParty::AWSGameLiftServerSDK
  80. )
  81. # Add ${gem_name}.Server.Tests to googletest
  82. ly_add_googletest(
  83. NAME Gem::${gem_name}.Server.Tests
  84. LABELS REQUIRES_tiaf
  85. )
  86. endif()