summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-05-15 09:32:30 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-05-21 15:22:32 (GMT)
commit0dfe395e3cb1a720c4853087db554a6827feaadb (patch)
tree83d9cbe0ee9843bc4aa0012d9a7064a3522ba018 /Source/cmMakefile.cxx
parentaa8a6fcee8c67b0516efcd745fb1d7a66d249096 (diff)
downloadCMake-0dfe395e3cb1a720c4853087db554a6827feaadb.zip
CMake-0dfe395e3cb1a720c4853087db554a6827feaadb.tar.gz
CMake-0dfe395e3cb1a720c4853087db554a6827feaadb.tar.bz2
Features: Add COMPILE_FEATURES generator expression.
Allow setting build properties based on the features available for a target. The availability of features is determined at generate-time by evaluating the link implementation. Ensure that the <LANG>_STANDARD determined while evaluating COMPILE_FEATURES in the link implementation is not lower than that provided by the INTERFACE of the link implementation. This is similar to handling of transitive properties such as POSITION_INDEPENDENT_CODE.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9d7b3c6..9f33b92 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -5187,6 +5187,28 @@ HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const
}
//----------------------------------------------------------------------------
+bool cmMakefile::IsLaterStandard(std::string const& lang,
+ std::string const& lhs,
+ std::string const& rhs)
+{
+ if (lang == "C")
+ {
+ const char * const *rhsIt = std::find_if(cmArrayBegin(C_STANDARDS),
+ cmArrayEnd(C_STANDARDS),
+ cmStrCmp(rhs));
+
+ return std::find_if(rhsIt, cmArrayEnd(C_STANDARDS),
+ cmStrCmp(lhs)) != cmArrayEnd(C_STANDARDS);
+ }
+ const char * const *rhsIt = std::find_if(cmArrayBegin(CXX_STANDARDS),
+ cmArrayEnd(CXX_STANDARDS),
+ cmStrCmp(rhs));
+
+ return std::find_if(rhsIt, cmArrayEnd(CXX_STANDARDS),
+ cmStrCmp(lhs)) != cmArrayEnd(CXX_STANDARDS);
+}
+
+//----------------------------------------------------------------------------
bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target,
const std::string& feature) const
{