CMakeLists.txt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER})
  9. include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  10. if(NOT PAL_TRAIT_BUILD_CRASH_HANDLER_SUPPORTED)
  11. return()
  12. endif()
  13. add_subdirectory(Support)
  14. ly_add_target(
  15. NAME CrashHandler STATIC
  16. NAMESPACE AZ
  17. FILES_CMAKE
  18. crash_handler_files.cmake
  19. ${pal_dir}/crash_handler_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  20. ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  21. INCLUDE_DIRECTORIES
  22. PUBLIC
  23. Shared
  24. PRIVATE
  25. ${pal_dir}
  26. BUILD_DEPENDENCIES
  27. PUBLIC
  28. AZ::CrashSupport
  29. PRIVATE
  30. 3rdParty::Crashpad
  31. AZ::AzFramework
  32. )
  33. string(REPLACE "." ";" version_list "${O3DE_INSTALL_VERSION_STRING}")
  34. list(GET version_list 0 EXE_VERSION_INFO_0)
  35. list(GET version_list 1 EXE_VERSION_INFO_1)
  36. list(LENGTH version_list version_component_count)
  37. if(${version_component_count} GREATER_EQUAL 3)
  38. list(GET version_list 2 EXE_VERSION_INFO_2)
  39. else()
  40. set(EXE_VERSION_INFO_2 0)
  41. endif()
  42. if(${version_component_count} GREATER_EQUAL 4)
  43. list(GET version_list 3 EXE_VERSION_INFO_3)
  44. else()
  45. set(EXE_VERSION_INFO_3 0)
  46. endif()
  47. ly_add_source_properties(
  48. SOURCES Shared/CrashHandler.cpp
  49. PROPERTY COMPILE_DEFINITIONS
  50. VALUES
  51. LY_BUILD=${O3DE_INSTALL_BUILD_VERSION}
  52. EXE_VERSION_INFO_0=${EXE_VERSION_INFO_0}
  53. EXE_VERSION_INFO_1=${EXE_VERSION_INFO_1}
  54. EXE_VERSION_INFO_2=${EXE_VERSION_INFO_2}
  55. EXE_VERSION_INFO_3=${EXE_VERSION_INFO_3}
  56. )
  57. ly_add_target(
  58. NAME CrashUploaderSupport STATIC
  59. NAMESPACE AZ
  60. FILES_CMAKE
  61. crash_uploader_support_files.cmake
  62. INCLUDE_DIRECTORIES
  63. PUBLIC
  64. Uploader/include
  65. PRIVATE
  66. Uploader/include/Uploader
  67. BUILD_DEPENDENCIES
  68. PUBLIC
  69. 3rdParty::Crashpad::Handler
  70. AZ::CrashSupport
  71. )
  72. add_subdirectory(Tools)