Help/CMAKE_LANG_COMPILER: Document Visual Studio, Xcode, GHS generators quirks

They don't support setting compiler via this variable, they use the
toolsets, so you could switch the compiler by choosing another toolset.

Closes: #21644
This commit is contained in:
leha-bot
2026-07-18 03:01:01 +03:00
committed by Brad King
parent 6a5e95f6c5
commit 90e2a33dba

View File

@@ -3,13 +3,21 @@ CMAKE_<LANG>_COMPILER
The full path to the compiler for ``LANG``.
This is the command that will be used as the ``<LANG>`` compiler. Once
set, you can not change this variable.
This is the command that will be used as the ``<LANG>`` compiler.
Once set, you can not change this variable.
.. note::
With :ref:`IDE Build Tool Generators`, including
:ref:`Visual Studio Generators` and :generator:`Xcode`, this variable is
computed automatically and should not be set. Instead, specify a toolset
using :option:`cmake -T`.
Usage
^^^^^
This variable can be set by the user during the first time a build tree is configured.
With :ref:`Command-Line Build Tool Generators` this variable can be
set by the user during the first time a build tree is configured.
If a non-full path value is supplied then CMake will resolve the full path of
the compiler.