summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-09 17:15:45 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-09 17:15:53 (GMT)
commit51e81d1f7354fc425b3fc210900cab37ca00926f (patch)
treefbd06710a3ba6dc94af59103e834846cf8670229 /Help
parent4802b27e64db507a36c73cdabd7fd2ef01fda228 (diff)
parent6ab9fbd43bfce25cf9ee71a81145a1e5f9dc4a12 (diff)
downloadCMake-51e81d1f7354fc425b3fc210900cab37ca00926f.zip
CMake-51e81d1f7354fc425b3fc210900cab37ca00926f.tar.gz
CMake-51e81d1f7354fc425b3fc210900cab37ca00926f.tar.bz2
Merge topic 'color-diagnostics'
6ab9fbd43b color: Add tests for CMAKE_COLOR_DIAGNOSTICS 78adb1b952 color: Add CMAKE_COLOR_DIAGNOSTICS environment variable 884d9de8b7 color: Introduce CMAKE_COLOR_DIAGNOSTICS variable Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Frank Dana <ferdnyc@gmail.com> Merge-request: !6990
Diffstat (limited to 'Help')
-rw-r--r--Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst9
-rw-r--r--Help/manual/cmake-env-variables.7.rst1
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/release/dev/color-diagnostics.rst10
-rw-r--r--Help/variable/CMAKE_COLOR_DIAGNOSTICS.rst37
5 files changed, 58 insertions, 0 deletions
diff --git a/Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst b/Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst
new file mode 100644
index 0000000..d3d0aa9
--- /dev/null
+++ b/Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst
@@ -0,0 +1,9 @@
+CMAKE_COLOR_DIAGNOSTICS
+-----------------------
+
+.. versionadded:: 3.24
+
+.. include:: ENV_VAR.txt
+
+Specifies a default value for the :variable:`CMAKE_COLOR_DIAGNOSTICS` variable
+when there is no explicit value given on the first run.
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 0799fdd..fc14262 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -31,6 +31,7 @@ Environment Variables that Control the Build
/envvar/CMAKE_APPLE_SILICON_PROCESSOR
/envvar/CMAKE_BUILD_PARALLEL_LEVEL
/envvar/CMAKE_BUILD_TYPE
+ /envvar/CMAKE_COLOR_DIAGNOSTICS
/envvar/CMAKE_CONFIGURATION_TYPES
/envvar/CMAKE_CONFIG_TYPE
/envvar/CMAKE_EXPORT_COMPILE_COMMANDS
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index ffebfff..f2fef54 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -172,6 +172,7 @@ Variables that Change Behavior
/variable/CMAKE_CODEBLOCKS_COMPILER_ID
/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES
/variable/CMAKE_CODELITE_USE_TARGETS
+ /variable/CMAKE_COLOR_DIAGNOSTICS
/variable/CMAKE_COLOR_MAKEFILE
/variable/CMAKE_CONFIGURATION_TYPES
/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY
diff --git a/Help/release/dev/color-diagnostics.rst b/Help/release/dev/color-diagnostics.rst
new file mode 100644
index 0000000..8e0e225
--- /dev/null
+++ b/Help/release/dev/color-diagnostics.rst
@@ -0,0 +1,10 @@
+color-diagnostics
+-----------------
+
+* The :variable:`CMAKE_COLOR_DIAGNOSTICS` variable was added to control
+ color diagnostics generated by compilers. This variable also controls
+ color buildsystem messages with :ref:`Makefile Generators`, replacing
+ :variable:`CMAKE_COLOR_MAKEFILE`.
+
+ The :envvar:`CMAKE_COLOR_DIAGNOSTICS` environment was added to set
+ a default value for :variable:`CMAKE_COLOR_DIAGNOSTICS`.
diff --git a/Help/variable/CMAKE_COLOR_DIAGNOSTICS.rst b/Help/variable/CMAKE_COLOR_DIAGNOSTICS.rst
new file mode 100644
index 0000000..a72c9e1
--- /dev/null
+++ b/Help/variable/CMAKE_COLOR_DIAGNOSTICS.rst
@@ -0,0 +1,37 @@
+CMAKE_COLOR_DIAGNOSTICS
+-----------------------
+
+.. versionadded:: 3.24
+
+Enable color diagnostics throughout.
+
+This variable uses three states: ``ON``, ``OFF`` and not defined.
+
+When not defined:
+
+* :ref:`Makefile Generators` initialize the :variable:`CMAKE_COLOR_MAKEFILE`
+ variable to ``ON``. It controls color buildsystem messages.
+
+* GNU/Clang compilers are not invoked with any color diagnostics flag.
+
+When ``ON``:
+
+* :ref:`Makefile Generators` produce color buildsystem messages by default.
+ :variable:`CMAKE_COLOR_MAKEFILE` is not initialized, but may be
+ explicitly set to ``OFF`` to disable color buildsystem messages.
+
+* GNU/Clang compilers are invoked with a flag enabling color diagnostics
+ (``-fcolor-diagnostics``).
+
+When ``OFF``:
+
+* :ref:`Makefile Generators` do not produce color buildsystem messages by
+ default. :variable:`CMAKE_COLOR_MAKEFILE` is not initialized, but may be
+ explicitly set to ``ON`` to enable color buildsystem messages.
+
+* GNU/Clang compilers are invoked with a flag disabling color diagnostics
+ (``-fno-color-diagnostics``).
+
+If the :envvar:`CMAKE_COLOR_DIAGNOSTICS` environment variable is set, its
+value is used. Otherwise, ``CMAKE_COLOR_DIAGNOSTICS`` is not defined by
+default.