summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-30 16:07:38 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-05-07 10:17:49 (GMT)
commit205215fb8a8aa950026d914377a54ae358a1c02a (patch)
tree2e847006ba3a5e19448058ff09ad6b496fe4b39b /Source/cmLocalGenerator.cxx
parent1df2116bfaa4c575404ae1eef225aed1530d668a (diff)
downloadCMake-205215fb8a8aa950026d914377a54ae358a1c02a.zip
CMake-205215fb8a8aa950026d914377a54ae358a1c02a.tar.gz
CMake-205215fb8a8aa950026d914377a54ae358a1c02a.tar.bz2
cmTarget: Add CXX_STANDARD_REQUIRED to control decay.
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())
{