summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-15 18:47:51 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-03-15 18:47:51 (GMT)
commitc7278633a7acfc4afc9d7976dc522fb4027e8cd2 (patch)
treed85aae96cdd30395d8e1a28c0e06107fa47ad433 /Source
parent3b6dbf71149c47e1e391e3e0663ae8476a7deaa9 (diff)
parent339d5922d9baef98c3a19fd0712badeb3d9e2996 (diff)
downloadCMake-c7278633a7acfc4afc9d7976dc522fb4027e8cd2.zip
CMake-c7278633a7acfc4afc9d7976dc522fb4027e8cd2.tar.gz
CMake-c7278633a7acfc4afc9d7976dc522fb4027e8cd2.tar.bz2
Merge topic 'validate-custom-commands-issue-11963'
339d592 Validate custom command arguments (#11963)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3fa846a..63bf03b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -893,6 +893,20 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
return;
}
+ // Validate custom commands. TODO: More strict?
+ for(cmCustomCommandLines::const_iterator i=commandLines.begin();
+ i != commandLines.end(); ++i)
+ {
+ cmCustomCommandLine const& cl = *i;
+ if(!cl.empty() && !cl[0].empty() && cl[0][0] == '"')
+ {
+ cmOStringStream e;
+ e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n";
+ this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return;
+ }
+ }
+
// Choose a source file on which to store the custom command.
cmSourceFile* file = 0;
if(main_dependency && main_dependency[0])