summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2021-01-10 10:40:56 (GMT)
committerRaul Tambre <raul@tambre.ee>2021-01-11 17:54:18 (GMT)
commite6e7f2cab96066b5e7f595177a59ea1461608201 (patch)
tree381d92cb4985aec5eb5e4fbe4f2e45a38a055759
parentfb797841362e3eeec4ce18bf53473dd6ebb33363 (diff)
downloadCMake-e6e7f2cab96066b5e7f595177a59ea1461608201.zip
CMake-e6e7f2cab96066b5e7f595177a59ea1461608201.tar.gz
CMake-e6e7f2cab96066b5e7f595177a59ea1461608201.tar.bz2
cmMakefile: Don't expand bracket arguments in --trace-expand
Bracket arguments are literal and shouldn't be expanded. Fixes #21671.
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Tests/RunCMake/CommandLine/trace-expand.cmake1
2 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0e4f888..3946841 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -308,7 +308,7 @@ void cmMakefile::PrintCommandTrace(
args.reserve(lff.Arguments().size());
for (cmListFileArgument const& arg : lff.Arguments()) {
- if (expand) {
+ if (expand && arg.Delim != cmListFileArgument::Bracket) {
temp = arg.Value;
this->ExpandVariablesInString(temp);
args.push_back(temp);
diff --git a/Tests/RunCMake/CommandLine/trace-expand.cmake b/Tests/RunCMake/CommandLine/trace-expand.cmake
index e69de29..24da02a 100644
--- a/Tests/RunCMake/CommandLine/trace-expand.cmake
+++ b/Tests/RunCMake/CommandLine/trace-expand.cmake
@@ -0,0 +1 @@
+set(a [[\B]])