diff options
author | Brad King <brad.king@kitware.com> | 2015-03-02 13:36:24 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-03-02 13:36:24 (GMT) |
commit | 17b4423c4509e747814f2c5564239ec72659b6f0 (patch) | |
tree | c0e7e25c8e548dcde0fe33cbcb78795647a1ef33 /Source/cmLocalGenerator.cxx | |
parent | a8b2224eb64e9a8b55634ba40dc1354bd3880d3d (diff) | |
parent | 00d66557d49989f9813ba9f04beaa0a984699cf0 (diff) | |
download | CMake-17b4423c4509e747814f2c5564239ec72659b6f0.zip CMake-17b4423c4509e747814f2c5564239ec72659b6f0.tar.gz CMake-17b4423c4509e747814f2c5564239ec72659b6f0.tar.bz2 |
Merge topic 'fix-crash-on-bad-LANG_STANDARD'
00d66557 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 42e943a..7c83f27 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2264,7 +2264,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); |