From 90e2a33dbabd28185d06359f3481fe12e63ae013 Mon Sep 17 00:00:00 2001 From: leha-bot Date: Sat, 18 Jul 2026 03:01:01 +0300 Subject: [PATCH] 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 --- Help/variable/CMAKE_LANG_COMPILER.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Help/variable/CMAKE_LANG_COMPILER.rst b/Help/variable/CMAKE_LANG_COMPILER.rst index db8f4e1faf..a6ffd84bb6 100644 --- a/Help/variable/CMAKE_LANG_COMPILER.rst +++ b/Help/variable/CMAKE_LANG_COMPILER.rst @@ -3,13 +3,21 @@ CMAKE__COMPILER The full path to the compiler for ``LANG``. -This is the command that will be used as the ```` compiler. Once -set, you can not change this variable. +This is the command that will be used as the ```` 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.