CMakeLists.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 this platform does not support google tests, it cannot support testrunner and there is no point in continuing.
  9. if(NOT PAL_TRAIT_TEST_GOOGLE_TEST_SUPPORTED)
  10. return()
  11. endif()
  12. o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER})
  13. include(${pal_dir}/platform_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  14. # note that LY_DISABLE_TEST_MODULES is a CMake variable that controls whether
  15. # test modules are built or not and it should be interpreted as "build our own
  16. # tests"... not as "support no testing at all if set".
  17. # We still need to build and ship AzTestRunner as part of the engine and installer
  18. # so that people using the installer can run their OWN tests.
  19. if(PAL_TRAIT_AZTESTRUNNER_SUPPORTED)
  20. ly_add_target(
  21. NAME AzTestRunner ${PAL_TRAIT_AZTESTRUNNER_LAUNCHER_TYPE}
  22. NAMESPACE AZ
  23. FILES_CMAKE
  24. aztestrunner_files.cmake
  25. ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  26. PLATFORM_INCLUDE_FILES
  27. ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  28. INCLUDE_DIRECTORIES
  29. PRIVATE
  30. src
  31. BUILD_DEPENDENCIES
  32. PRIVATE
  33. AZ::AzCore
  34. AZ::AzTest
  35. )
  36. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  37. ly_add_target(
  38. NAME AzTestRunner.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  39. NAMESPACE AZ
  40. FILES_CMAKE
  41. aztestrunner_test_files.cmake
  42. BUILD_DEPENDENCIES
  43. PRIVATE
  44. AZ::AzTest
  45. )
  46. ly_add_googletest(
  47. NAME AZ::AzTestRunner.Tests
  48. )
  49. endif()
  50. endif()