Optionally suppress errors in cmGeneratorExpression

This commit is contained in:
Brad King 2010-12-08 13:32:09 -05:00
parent 45e1953c40
commit ef9e9de0b8
2 changed files with 7 additions and 4 deletions

View File

@ -17,8 +17,8 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression( cmGeneratorExpression::cmGeneratorExpression(
cmMakefile* mf, const char* config, cmMakefile* mf, const char* config,
cmListFileBacktrace const& backtrace): cmListFileBacktrace const& backtrace, bool quiet):
Makefile(mf), Config(config), Backtrace(backtrace) Makefile(mf), Config(config), Backtrace(backtrace), Quiet(quiet)
{ {
this->TargetInfo.compile("^\\$<TARGET" this->TargetInfo.compile("^\\$<TARGET"
"(|_SONAME|_LINKER)" // File with what purpose? "(|_SONAME|_LINKER)" // File with what purpose?
@ -87,7 +87,7 @@ bool cmGeneratorExpression::Evaluate()
this->Data.insert(this->Data.end(), result.begin(), result.end()); this->Data.insert(this->Data.end(), result.begin(), result.end());
return true; return true;
} }
else else if(!this->Quiet)
{ {
// Failure. Report the error message. // Failure. Report the error message.
cmOStringStream e; cmOStringStream e;
@ -99,6 +99,7 @@ bool cmGeneratorExpression::Evaluate()
this->Backtrace); this->Backtrace);
return false; return false;
} }
return true;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -32,7 +32,8 @@ class cmGeneratorExpression
public: public:
/** Construct with an evaluation context and configuration. */ /** Construct with an evaluation context and configuration. */
cmGeneratorExpression(cmMakefile* mf, const char* config, cmGeneratorExpression(cmMakefile* mf, const char* config,
cmListFileBacktrace const& backtrace); cmListFileBacktrace const& backtrace,
bool quiet = false);
/** Evaluate generator expressions in a string. */ /** Evaluate generator expressions in a string. */
const char* Process(std::string const& input); const char* Process(std::string const& input);
@ -41,6 +42,7 @@ private:
cmMakefile* Makefile; cmMakefile* Makefile;
const char* Config; const char* Config;
cmListFileBacktrace const& Backtrace; cmListFileBacktrace const& Backtrace;
bool Quiet;
std::vector<char> Data; std::vector<char> Data;
std::stack<size_t> Barriers; std::stack<size_t> Barriers;
cmsys::RegularExpression TargetInfo; cmsys::RegularExpression TargetInfo;