PAL_windows.cmake 2.3 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. include(cmake/CompilerSettings.cmake)
  9. ly_set(PAL_EXECUTABLE_APPLICATION_FLAG WIN32)
  10. ly_set(PAL_LINKOPTION_MODULE MODULE)
  11. ly_set(PAL_TRAIT_BUILD_HOST_GUI_TOOLS TRUE)
  12. ly_set(PAL_TRAIT_BUILD_HOST_TOOLS TRUE)
  13. ly_set(PAL_TRAIT_BUILD_SERVER_SUPPORTED TRUE)
  14. ly_set(PAL_TRAIT_BUILD_UNIFIED_SUPPORTED TRUE)
  15. ly_set(PAL_TRAIT_BUILD_UNITY_SUPPORTED TRUE)
  16. ly_set(PAL_TRAIT_BUILD_UNITY_EXCLUDE_EXTENSIONS)
  17. ly_set(PAL_TRAIT_BUILD_EXCLUDE_ALL_TEST_RUNS_FROM_IDE FALSE)
  18. ly_set(PAL_TRAIT_BUILD_CPACK_SUPPORTED TRUE)
  19. ly_set(PAL_TRAIT_PROF_PIX_SUPPORTED TRUE)
  20. # Determine if tests are supported based on the PAL_TRAIT_BUILD_TESTS_SUPPORTED_DEFAULT global property
  21. get_property(is_test_supported_default_set GLOBAL PROPERTY PAL_TRAIT_BUILD_TESTS_SUPPORTED_DEFAULT SET)
  22. if (is_test_supported_default_set)
  23. get_property(test_supported_default GLOBAL PROPERTY PAL_TRAIT_BUILD_TESTS_SUPPORTED_DEFAULT)
  24. ly_set(PAL_TRAIT_BUILD_TESTS_SUPPORTED ${test_supported_default})
  25. else()
  26. ly_set(PAL_TRAIT_BUILD_TESTS_SUPPORTED TRUE)
  27. endif()
  28. # Test library support
  29. ly_set(PAL_TRAIT_TEST_GOOGLE_TEST_SUPPORTED TRUE)
  30. ly_set(PAL_TRAIT_TEST_GOOGLE_BENCHMARK_SUPPORTED TRUE)
  31. ly_set(PAL_TRAIT_TEST_LYTESTTOOLS_SUPPORTED TRUE)
  32. ly_set(PAL_TRAIT_TEST_PYTEST_SUPPORTED TRUE)
  33. ly_set(PAL_TRAIT_TEST_TARGET_TYPE MODULE)
  34. if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
  35. ly_set(PAL_TRAIT_COMPILER_ID MSVC)
  36. ly_set(PAL_TRAIT_COMPILER_ID_LOWERCASE msvc)
  37. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  38. ly_set(PAL_TRAIT_COMPILER_ID Clang)
  39. ly_set(PAL_TRAIT_COMPILER_ID_LOWERCASE clang)
  40. else()
  41. message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported in ${PAL_PLATFORM_NAME}")
  42. endif()
  43. # Set the default asset type for deployment
  44. set(LY_ASSET_DEPLOY_ASSET_TYPE "pc" CACHE STRING "Set the asset type for deployment.")
  45. # Set the python cmd tool
  46. ly_set(LY_PYTHON_CMD ${CMAKE_CURRENT_SOURCE_DIR}/python/python.cmd)
  47. # Compiler flag to export all symbols from a library
  48. # On Windows this is done directly with the WINDOWS_EXPORT_ALL_SYMBOLS cmake option instead
  49. ly_set(PAL_TRAIT_EXPORT_ALL_SYMBOLS_COMPILE_OPTIONS)