summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index a29a0cd..afb2ce8 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2161,6 +2161,26 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target,
bool ext = target->GetPropertyAsBool(extProp);
std::string type = ext ? "EXTENSION" : "STANDARD";
+ if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED"))
+ {
+ std::string option_flag =
+ "CMAKE_" + lang + standardProp
+ + "_" + type + "_COMPILE_OPTION";
+
+ const char *opt = target->GetMakefile()->GetDefinition(option_flag);
+ if (!opt)
+ {
+ cmOStringStream e;
+ e << "Target \"" << target->GetName() << "\" requires the language "
+ "dialect \"" << lang << standardProp << "\" "
+ << (ext ? "(with compiler extensions)" : "") << ", but CMake "
+ "does not know the compile flags to use to enable it.";
+ this->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
+ this->AppendFlags(flags, opt);
+ return;
+ }
+
static std::map<std::string, std::vector<std::string> > langStdMap;
if (langStdMap.empty())
{