|
|
@@ -1459,6 +1459,7 @@ void cmLocalGenerator::AddCompileOptions(
|
|
|
this->AppendFlagEscape(flags, *i);
|
|
|
}
|
|
|
}
|
|
|
+ this->AddCompilerRequirementFlag(flags, target, lang);
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
@@ -2128,6 +2129,34 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+void cmLocalGenerator::
|
|
|
+AddCompilerRequirementFlag(std::string &flags, cmTarget* target,
|
|
|
+ const std::string& lang)
|
|
|
+{
|
|
|
+ if (lang.empty())
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ std::string stdProp = lang + "_STANDARD";
|
|
|
+ const char *standard = target->GetProperty(stdProp);
|
|
|
+ if (!standard)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ std::string extProp = lang + "_EXTENSIONS";
|
|
|
+ bool ext = target->GetPropertyAsBool(extProp);
|
|
|
+ std::string type = ext ? "EXTENSION" : "STANDARD";
|
|
|
+
|
|
|
+ std::string compile_option =
|
|
|
+ "CMAKE_" + lang + std::string(standard)
|
|
|
+ + "_" + type + "_COMPILE_OPTION";
|
|
|
+ if (const char *opt = target->GetMakefile()->GetDefinition(compile_option))
|
|
|
+ {
|
|
|
+ this->AppendFlags(flags, opt);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void AddVisibilityCompileOption(std::string &flags, cmTarget* target,
|
|
|
cmLocalGenerator *lg,
|
|
|
const std::string& lang)
|