diff options
author | Brad King <brad.king@kitware.com> | 2018-07-16 17:06:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-07-16 18:46:43 (GMT) |
commit | 406f397e8b5524107457cc2d70bd22878350e9e1 (patch) | |
tree | 9ff09e0750b1b7e98c690f50da265869643afc43 /Source/cmMathCommand.cxx | |
parent | dd5c54600b6f651898925bfd9ec4406ccfc7be95 (diff) | |
download | CMake-406f397e8b5524107457cc2d70bd22878350e9e1.zip CMake-406f397e8b5524107457cc2d70bd22878350e9e1.tar.gz CMake-406f397e8b5524107457cc2d70bd22878350e9e1.tar.bz2 |
math: Restore toleration of unexpected characters in an expression
Prior to commit 7c4c13ffef (math: Reject unexpected expression input
explicitly, 2018-05-18) we ignored unexpected characters in an
expression that otherwise can be parsed. In order to preserve
compatibility with projects that accidentally used this, convert the
error to a warning.
Diffstat (limited to 'Source/cmMathCommand.cxx')
-rw-r--r-- | Source/cmMathCommand.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx index 5d1b099..a50e5fc 100644 --- a/Source/cmMathCommand.cxx +++ b/Source/cmMathCommand.cxx @@ -5,6 +5,7 @@ #include "cmExprParserHelper.h" #include "cmMakefile.h" #include "cm_kwiml.h" +#include "cmake.h" #include <stdio.h> @@ -101,6 +102,11 @@ bool cmMathCommand::HandleExprCommand(std::vector<std::string> const& args) } sprintf(buffer, fmt, helper.GetResult()); + std::string const& w = helper.GetWarning(); + if (!w.empty()) { + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w); + } + this->Makefile->AddDefinition(outputVariable, buffer); return true; } |