CMakeLists.txt 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  9. set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common)
  10. ly_add_target(
  11. NAME ${gem_name}.Static STATIC
  12. NAMESPACE Gem
  13. FILES_CMAKE
  14. metastream_files.cmake
  15. INCLUDE_DIRECTORIES
  16. PRIVATE
  17. Source
  18. PUBLIC
  19. Include
  20. BUILD_DEPENDENCIES
  21. PUBLIC
  22. AZ::AzCore
  23. PRIVATE
  24. Legacy::CryCommon
  25. )
  26. ly_add_target(
  27. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  28. NAMESPACE Gem
  29. FILES_CMAKE
  30. metastream_shared_files.cmake
  31. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  32. PLATFORM_INCLUDE_FILES
  33. ${pal_source_dir}/metastream_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  34. ${common_source_dir}/${PAL_TRAIT_COMPILER_ID}/metastream_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  35. INCLUDE_DIRECTORIES
  36. PRIVATE
  37. Source
  38. ${pal_source_dir}
  39. PUBLIC
  40. Include
  41. BUILD_DEPENDENCIES
  42. PRIVATE
  43. Gem::${gem_name}.Static
  44. Legacy::CryCommon
  45. )
  46. # Inject the gem name into the Module source file
  47. ly_add_source_properties(
  48. SOURCES
  49. Source/MetastreamGem.cpp
  50. PROPERTY COMPILE_DEFINITIONS
  51. VALUES
  52. O3DE_GEM_NAME=${gem_name}
  53. O3DE_GEM_VERSION=${gem_version})
  54. # The above "${gem_name}" target is used by all types of applications, including dev tools.
  55. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  56. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  57. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  58. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name})
  59. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name})
  60. ################################################################################
  61. # Tests
  62. ################################################################################
  63. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  64. ly_add_target(
  65. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  66. NAMESPACE Gem
  67. FILES_CMAKE
  68. metastream_tests_files.cmake
  69. metastream_shared_files.cmake
  70. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  71. PLATFORM_INCLUDE_FILES
  72. ${pal_source_dir}/metastream_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  73. ${common_source_dir}/${PAL_TRAIT_COMPILER_ID}/metastream_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  74. INCLUDE_DIRECTORIES
  75. PRIVATE
  76. Tests
  77. Source
  78. ${pal_source_dir}
  79. BUILD_DEPENDENCIES
  80. PRIVATE
  81. AZ::AzTest
  82. Gem::${gem_name}.Static
  83. Legacy::CryCommon
  84. )
  85. ly_add_googletest(
  86. NAME Gem::${gem_name}.Tests
  87. LABELS REQUIRES_tiaf
  88. )
  89. endif()