CompilerSettings.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031
  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. # File to tweak compiler settings before compiler detection happens (before project() is called)
  9. # We dont have PAL enabled at this point, so we can only use pure-CMake variables
  10. # if we are in Script Only ("Quick Start") Mode, we override the compiler with a do-nothing fake one
  11. # doing so is slightly different on each platform, so it uses a different file each.
  12. get_property(O3DE_SCRIPT_ONLY GLOBAL PROPERTY "O3DE_SCRIPT_ONLY")
  13. if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
  14. if(O3DE_SCRIPT_ONLY)
  15. include(${CMAKE_CURRENT_LIST_DIR}/Platform/Linux/Toolchain_scriptonly_linux.cmake)
  16. else()
  17. include(${CMAKE_CURRENT_LIST_DIR}/Platform/Linux/CompilerSettings_linux.cmake)
  18. endif()
  19. elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
  20. if(O3DE_SCRIPT_ONLY)
  21. include(${CMAKE_CURRENT_LIST_DIR}/Platform/Windows/Toolchain_scriptonly_windows.cmake)
  22. endif()
  23. elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin")
  24. if(O3DE_SCRIPT_ONLY)
  25. message(FATAL_ERROR "Script only (quick start) projects are not yet supported on MacOS")
  26. endif()
  27. endif()