diff options
author | Brad King <brad.king@kitware.com> | 2014-07-30 17:39:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-30 17:48:33 (GMT) |
commit | b2282631f61361fe5f103fa7479073f2693eafcb (patch) | |
tree | eaf50e5c0daf9383ce493a9a2024d55ad4a967f3 /Source/cmTarget.cxx | |
parent | 8d1306cd1b2ab7af0360387bfbdd9beff29b480c (diff) | |
download | CMake-b2282631f61361fe5f103fa7479073f2693eafcb.zip CMake-b2282631f61361fe5f103fa7479073f2693eafcb.tar.gz CMake-b2282631f61361fe5f103fa7479073f2693eafcb.tar.bz2 |
cmTarget: Do not mistake a preceding error for a CMP0049 failure
After calls to ProcessSourceItemCMP0049, check for an empty return
string to detect a failure instead of trusting GetErrorOccuredFlag.
The latter could have been left from a preceding non-fatal error.
Extend the RunCMake.Configure test to cover a case that exposed this
problem.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ca24d2d..acae0b3 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -927,10 +927,13 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs) if(!(src[0] == '$' && src[1] == '<')) { - filename = this->ProcessSourceItemCMP0049(filename); - if (cmSystemTools::GetErrorOccuredFlag()) + if(!filename.empty()) { - return; + filename = this->ProcessSourceItemCMP0049(filename); + if(filename.empty()) + { + return; + } } this->Makefile->GetOrCreateSource(filename); } @@ -998,8 +1001,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s) cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s) { std::string src = this->ProcessSourceItemCMP0049(s); - - if (cmSystemTools::GetErrorOccuredFlag()) + if(!s.empty() && src.empty()) { return 0; } |