3
0

CMakeLists.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. # Currently we are in the Code folder: ${CMAKE_CURRENT_LIST_DIR}
  9. # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}
  10. # Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform
  11. # in which case it will see if that platform is present here or in the restricted folder.
  12. # i.e. It could here in our gem : Gems/RemoteTools/Code/Platform/<platorm_name> or
  13. # <restricted_folder>/<platform_name>/Gems/RemoteTools/Code
  14. o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_name}")
  15. # Now that we have the platform abstraction layer (PAL) folder for this folder, that's where we will find the
  16. # traits for this platform. Traits for a platform are defines for things like whether or not something in this gem
  17. # is supported by this platform.
  18. include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  19. # Add the RemoteTools.Private.Static target
  20. # Note: We include the common files and the platform specific files which are set in remotetools_common_files.cmake
  21. # and in ${pal_dir}/remotetools_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  22. ly_add_target(
  23. NAME RemoteTools.Private.Static STATIC
  24. NAMESPACE Gem
  25. FILES_CMAKE
  26. remotetools_files.cmake
  27. remotetools_autogen_files.cmake
  28. ${pal_dir}/remotetools_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  29. TARGET_PROPERTIES
  30. O3DE_PRIVATE_TARGET TRUE
  31. INCLUDE_DIRECTORIES
  32. PRIVATE
  33. Include
  34. Source
  35. BUILD_DEPENDENCIES
  36. PUBLIC
  37. AZ::AzCore
  38. AZ::AzFramework
  39. AZ::AzNetworking
  40. AUTOGEN_RULES
  41. *.AutoPackets.xml,AutoPackets_Header.jinja,$path/$fileprefix.AutoPackets.h
  42. *.AutoPackets.xml,AutoPackets_Inline.jinja,$path/$fileprefix.AutoPackets.inl
  43. *.AutoPackets.xml,AutoPackets_Source.jinja,$path/$fileprefix.AutoPackets.cpp
  44. *.AutoPackets.xml,AutoPacketDispatcher_Header.jinja,$path/$fileprefix.AutoPacketDispatcher.h
  45. *.AutoPackets.xml,AutoPacketDispatcher_Inline.jinja,$path/$fileprefix.AutoPacketDispatcher.inl
  46. )
  47. # Here add RemoteTools target, it depends on the RemoteTools.Private.Static
  48. ly_add_target(
  49. NAME RemoteTools ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  50. NAMESPACE Gem
  51. FILES_CMAKE
  52. remotetools_shared_files.cmake
  53. ${pal_dir}/remotetools_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  54. INCLUDE_DIRECTORIES
  55. PUBLIC
  56. Include
  57. PRIVATE
  58. Source
  59. BUILD_DEPENDENCIES
  60. PRIVATE
  61. Gem::RemoteTools.Private.Static
  62. )
  63. # By default, we will specify that the above target RemoteTools would be used by
  64. # Client, Server and Tools type targets when this gem is enabled. If you don't want it
  65. # active in Clients, Servers and Tools by default, delete one or all of the following lines:
  66. ly_create_alias(NAME RemoteTools.Clients NAMESPACE Gem TARGETS Gem::RemoteTools)
  67. ly_create_alias(NAME RemoteTools.Servers NAMESPACE Gem TARGETS Gem::RemoteTools)
  68. ly_create_alias(NAME RemoteTools.Unified NAMESPACE Gem TARGETS Gem::RemoteTools)
  69. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  70. ly_create_alias(NAME RemoteTools.Tools NAMESPACE Gem TARGETS Gem::RemoteTools)
  71. ly_create_alias(NAME RemoteTools.LuaTools NAMESPACE Gem TARGETS Gem::RemoteTools)
  72. endif()
  73. ################################################################################
  74. # Tests
  75. ################################################################################
  76. # See if globally, tests are supported
  77. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  78. # We globally support tests, see if we support tests on this platform for RemoteTools.Tests
  79. if(PAL_TRAIT_REMOTETOOLS_TEST_SUPPORTED)
  80. # We support RemoteTools.Tests on this platform, add RemoteTools.Tests target which depends on RemoteTools.Private.Static
  81. ly_add_target(
  82. NAME RemoteTools.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  83. NAMESPACE Gem
  84. FILES_CMAKE
  85. remotetools_tests_files.cmake
  86. INCLUDE_DIRECTORIES
  87. PRIVATE
  88. Tests
  89. Source
  90. BUILD_DEPENDENCIES
  91. PRIVATE
  92. AZ::AzTest
  93. AZ::AzFramework
  94. Gem::RemoteTools.Private.Static
  95. )
  96. # Add RemoteTools.Tests to googletest
  97. ly_add_googletest(
  98. NAME Gem::RemoteTools.Tests
  99. LABELS REQUIRES_tiaf
  100. )
  101. endif()
  102. endif()