diff options
author | Brad King <brad.king@kitware.com> | 2017-02-03 15:08:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-06 14:53:15 (GMT) |
commit | f8f3cb8d65d3ddbd8840814df7df884a2714b88e (patch) | |
tree | 6a155f4c64a1e83030356f7626e6f23f1c39a827 /Source/cmGlobalVisualStudio8Generator.cxx | |
parent | 6286d26ca6408cfc45031536ed54b1679e6d5ac2 (diff) | |
download | CMake-f8f3cb8d65d3ddbd8840814df7df884a2714b88e.zip CMake-f8f3cb8d65d3ddbd8840814df7df884a2714b88e.tar.gz CMake-f8f3cb8d65d3ddbd8840814df7df884a2714b88e.tar.bz2 |
VS: Fix quoting of special characters in cmake re-run check commands
Fix our calls to `AddCustomCommandToOutput` for adding cmake re-run
check commands to disable old-style quoting in favor of the full quoting
logic. This is necessary when paths contain special characters like `&`
that old-style quoting logic does not handle.
This also requires us to expand the `$(SolutionPath)` placeholder
explicitly because otherwise its expanded value will no longer be quoted
correctly. As a side effect, this fixes the value in VS 10 and above
where the placeholder may be undefined when driving the build through
MSBuild without the `.sln` file.
Reported-by: Steven Cook <sc@harshbutfair.org>
Fixes: #16585
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index e961a3d..8353a3f 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -298,7 +298,9 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() commandLine.push_back("--check-stamp-list"); commandLine.push_back(stampList.c_str()); commandLine.push_back("--vs-solution-file"); - commandLine.push_back("\"$(SolutionPath)\""); + std::string const sln = std::string(lg->GetBinaryDirectory()) + "/" + + lg->GetProjectName() + ".sln"; + commandLine.push_back(sln); cmCustomCommandLines commandLines; commandLines.push_back(commandLine); @@ -310,7 +312,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() std::vector<std::string> no_byproducts; if (cmSourceFile* file = mf->AddCustomCommandToOutput( stamps, no_byproducts, listFiles, no_main_dependency, commandLines, - "Checking Build System", no_working_directory, true)) { + "Checking Build System", no_working_directory, true, false)) { gt->AddSource(file->GetFullPath()); } else { cmSystemTools::Error("Error adding rule for ", stamps[0].c_str()); |