From db8425be18439c899c08294dde117cc137c75d23 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 11 Apr 2015 14:16:44 +0200 Subject: [PATCH] cmake: Get enabled languages from cmState. The check for a global generator is redundant - the enabled languages are only populated by the global generator. --- Source/cmake.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 6adecee4f..94b0ae0c7 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2343,14 +2343,9 @@ const char *cmake::GetProperty(const std::string& prop, } else if ( prop == "ENABLED_LANGUAGES" ) { - std::string lang; - if(this->GlobalGenerator) - { - std::vector enLangs; - this->GlobalGenerator->GetEnabledLanguages(enLangs); - lang = cmJoin(enLangs, ";"); - } - this->SetProperty("ENABLED_LANGUAGES", lang.c_str()); + std::string langs; + langs = cmJoin(this->State->GetEnabledLanguages(), ";"); + this->SetProperty("ENABLED_LANGUAGES", langs.c_str()); } #define STRING_LIST_ELEMENT(F) ";" #F if (prop == "CMAKE_C_KNOWN_FEATURES")