Visual Studio 17 2022.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Visual Studio 17 2022
  2. ---------------------
  3. .. versionadded:: 3.21
  4. Generates Visual Studio 17 (VS 2022) project files.
  5. Project Types
  6. ^^^^^^^^^^^^^
  7. Only Visual C++ and C# projects may be generated (and Fortran with
  8. Intel compiler integration). Other types of projects (JavaScript,
  9. Powershell, Python, etc.) are not supported.
  10. Instance Selection
  11. ^^^^^^^^^^^^^^^^^^
  12. VS 2022 supports multiple installations on the same machine. The
  13. :variable:`CMAKE_GENERATOR_INSTANCE` variable may be used to select one.
  14. Platform Selection
  15. ^^^^^^^^^^^^^^^^^^
  16. The default target platform name (architecture) is that of the host
  17. and is provided in the :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable.
  18. The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
  19. via the :option:`cmake -A` option, to specify a target platform
  20. name (architecture). For example:
  21. * ``cmake -G "Visual Studio 17 2022" -A Win32``
  22. * ``cmake -G "Visual Studio 17 2022" -A x64``
  23. * ``cmake -G "Visual Studio 17 2022" -A ARM``
  24. * ``cmake -G "Visual Studio 17 2022" -A ARM64``
  25. Toolset Selection
  26. ^^^^^^^^^^^^^^^^^
  27. The ``v143`` toolset that comes with VS 17 2022 is selected by default.
  28. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
  29. via the :option:`cmake -T` option, to specify another toolset.
  30. .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
  31. By default this generator uses the 64-bit variant on x64 hosts and
  32. the 32-bit variant otherwise.
  33. .. include:: include/VS_TOOLSET_HOST_ARCH.rst