diff options
author | Raul Tambre <raul@tambre.ee> | 2021-01-10 12:40:56 +0200 |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-01-11 19:54:18 +0200 |
commit | e6e7f2cab96066b5e7f595177a59ea1461608201 (patch) | |
tree | 381d92cb4985aec5eb5e4fbe4f2e45a38a055759 | |
parent | fb797841362e3eeec4ce18bf53473dd6ebb33363 (diff) | |
download | cmake-e6e7f2cab96066b5e7f595177a59ea1461608201.tar.gz |
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.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/trace-expand.cmake | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0e4f888f03..39468417e5 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 e69de29bb2..24da02a674 100644 --- a/Tests/RunCMake/CommandLine/trace-expand.cmake +++ b/Tests/RunCMake/CommandLine/trace-expand.cmake @@ -0,0 +1 @@ +set(a [[\B]]) |