diff options
author | Brad King <brad.king@kitware.com> | 2015-02-27 21:48:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-28 17:14:42 (GMT) |
commit | 00d66557d49989f9813ba9f04beaa0a984699cf0 (patch) | |
tree | 921297d0937dbdfb57b9103ec23994cd1dc44d78 /Source/cmLocalGenerator.cxx | |
parent | 99575c9ac114e6f5d388e1ee7b9a3f788d773c9e (diff) | |
download | CMake-00d66557d49989f9813ba9f04beaa0a984699cf0.zip CMake-00d66557d49989f9813ba9f04beaa0a984699cf0.tar.gz CMake-00d66557d49989f9813ba9f04beaa0a984699cf0.tar.bz2 |
Diagnose invalid <LANG>_STANDARD value instead of crashing (#15426)
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7ca7684..b64383f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2270,7 +2270,14 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, std::vector<std::string>::const_iterator stdIt = std::find(stds.begin(), stds.end(), standard); - assert(stdIt != stds.end()); + if (stdIt == stds.end()) + { + std::string e = + lang + "_STANDARD is set to invalid value '" + standard + "'"; + this->GetGlobalGenerator()->GetCMakeInstance() + ->IssueMessage(cmake::FATAL_ERROR, e, target->GetBacktrace()); + return; + } std::vector<std::string>::const_iterator defaultStdIt = std::find(stds.begin(), stds.end(), defaultStd); |