summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-06-08 04:02:13 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-06-08 15:05:11 (GMT)
commit8195aa30269773732902029741fb8adfe13aa83d (patch)
tree33f795e6dcdcf548c989d15eab8d11f81aa5026a /Source/cmLocalUnixMakefileGenerator3.cxx
parentc01091d2cf786f361a47a2875ba73d05c1642488 (diff)
downloadCMake-8195aa30269773732902029741fb8adfe13aa83d.zip
CMake-8195aa30269773732902029741fb8adfe13aa83d.tar.gz
CMake-8195aa30269773732902029741fb8adfe13aa83d.tar.bz2
Makefiles: quote `$(COLOR)` expansions
This handles the case where `COLOR` is set to some ANSI-like color sequence in the ambient environment. These sequences tend to include `;` which terminates the command and tries to use the next component (typically an integer, possibly with a trailing `m`) with errors like: /bin/sh: line 1: 2: command not found /bin/sh: line 1: 255: command not found /bin/sh: line 1: 221: command not found /bin/sh: line 1: 255m: command not found Also add a test that sets `COLOR` in the environment which affects the generated Makefiles behavior. See: https://discourse.cmake.org/t/cmake-failing-gcc-compiler-checks/8277
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 43711b3..3c6b303 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1222,7 +1222,7 @@ void cmLocalUnixMakefileGenerator3::AppendEcho(
} else {
// Use cmake to echo the text in color.
cmd = cmStrCat(
- "@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) ",
+ "@$(CMAKE_COMMAND) -E cmake_echo_color \"--switch=$(COLOR)\" ",
color_name);
if (progress) {
cmd += "--progress-dir=";