diff options
author | Brad King <brad.king@kitware.com> | 2015-01-15 14:59:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-15 14:59:19 (GMT) |
commit | d58396b722bd4120306aafd08211cc09287bb670 (patch) | |
tree | b05760527db4a3a696a70a728861ae5ed60d162e | |
parent | 0fcdc57b7b9bbdeaa77c6751b92fd6a14394d1b4 (diff) | |
parent | 45ec182d27dc27412c94ccb49632e22a55d5fbe4 (diff) | |
download | CMake-d58396b722bd4120306aafd08211cc09287bb670.zip CMake-d58396b722bd4120306aafd08211cc09287bb670.tar.gz CMake-d58396b722bd4120306aafd08211cc09287bb670.tar.bz2 |
Merge branch 'fix-COMPILE_FEATURES-genex' into release
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 9 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 11 | ||||
-rw-r--r-- | Source/cmMakefile.h | 6 |
3 files changed, 17 insertions, 9 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 84a4daa..d5d78d5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1373,10 +1373,17 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode for (LangMap::const_iterator lit = testedFeatures.begin(); lit != testedFeatures.end(); ++lit) { + std::vector<std::string> const& langAvailable + = availableFeatures[lit->first]; for (std::vector<std::string>::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { - if (!context->Makefile->HaveFeatureAvailable(target, + if (std::find(langAvailable.begin(), langAvailable.end(), *it) + == langAvailable.end()) + { + return "0"; + } + if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { if (evalLL) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b7e89b8..ab77e4a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5130,18 +5130,19 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const } //---------------------------------------------------------------------------- -bool cmMakefile::HaveFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const { return lang == "C" - ? this->HaveCFeatureAvailable(target, feature) - : this->HaveCxxFeatureAvailable(target, feature); + ? this->HaveCStandardAvailable(target, feature) + : this->HaveCxxStandardAvailable(target, feature); } //---------------------------------------------------------------------------- bool cmMakefile:: -HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const +HaveCStandardAvailable(cmTarget const* target, + const std::string& feature) const { bool needC90 = false; bool needC99 = false; @@ -5218,7 +5219,7 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, } //---------------------------------------------------------------------------- -bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { bool needCxx98 = false; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 28f8686..24a4f00 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -935,7 +935,7 @@ public: const char* CompileFeaturesAvailable(const std::string& lang, std::string *error) const; - bool HaveFeatureAvailable(cmTarget const* target, std::string const& lang, + bool HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const; bool IsLaterStandard(std::string const& lang, @@ -1158,9 +1158,9 @@ private: void CheckNeededCxxLanguage(const std::string& feature, bool& needCxx98, bool& needCxx11, bool& needCxx14) const; - bool HaveCFeatureAvailable(cmTarget const* target, + bool HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const; - bool HaveCxxFeatureAvailable(cmTarget const* target, + bool HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const; mutable bool SuppressWatches; |