diff options
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 099f705..c8b13ad 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -90,7 +90,7 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm) this->TryCompileTimeout = 0; this->ExtraGenerator = CM_NULLPTR; - this->CurrentMakefile = CM_NULLPTR; + this->CurrentConfigureMakefile = CM_NULLPTR; this->TryCompileOuterMakefile = CM_NULLPTR; this->ConfigureDoneCMP0026AndCMP0024 = false; @@ -490,7 +490,6 @@ void cmGlobalGenerator::EnableLanguage( windowsVersionString << osviex.dwMajorVersion << "." << osviex.dwMinorVersion << "." << osviex.dwBuildNumber; - windowsVersionString.str(); mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString.str().c_str()); #endif @@ -1075,7 +1074,7 @@ bool cmGlobalGenerator::GetLanguageEnabled(const std::string& l) const void cmGlobalGenerator::ClearEnabledLanguages() { - return this->CMakeInstance->GetState()->ClearEnabledLanguages(); + this->CMakeInstance->GetState()->ClearEnabledLanguages(); } void cmGlobalGenerator::CreateLocalGenerators() @@ -2812,7 +2811,12 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) #ifdef CMAKE_BUILD_WITH_CMAKE // Check whether labels are enabled for this target. - if (const char* value = target->GetProperty("LABELS")) { + const char* targetLabels = target->GetProperty("LABELS"); + const char* directoryLabels = + target->Target->GetMakefile()->GetProperty("LABELS"); + const char* cmakeDirectoryLabels = + target->Target->GetMakefile()->GetDefinition("CMAKE_DIRECTORY_LABELS"); + if (targetLabels || directoryLabels || cmakeDirectoryLabels) { Json::Value lj_root(Json::objectValue); Json::Value& lj_target = lj_root["target"] = Json::objectValue; lj_target["name"] = target->GetName(); @@ -2822,19 +2826,53 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) cmSystemTools::MakeDirectory(dir.c_str()); cmGeneratedFileStream fout(file.c_str()); + std::vector<std::string> labels; + // List the target-wide labels. All sources in the target get // these labels. - std::vector<std::string> labels; - cmSystemTools::ExpandListArgument(value, labels); - if (!labels.empty()) { - fout << "# Target labels\n"; - for (std::vector<std::string>::const_iterator li = labels.begin(); - li != labels.end(); ++li) { - fout << " " << *li << "\n"; - lj_target_labels.append(*li); + if (targetLabels) { + cmSystemTools::ExpandListArgument(targetLabels, labels); + if (!labels.empty()) { + fout << "# Target labels\n"; + for (std::vector<std::string>::const_iterator li = labels.begin(); + li != labels.end(); ++li) { + fout << " " << *li << "\n"; + lj_target_labels.append(*li); + } } } + // List directory labels + std::vector<std::string> directoryLabelsList; + std::vector<std::string> cmakeDirectoryLabelsList; + + if (directoryLabels) { + cmSystemTools::ExpandListArgument(directoryLabels, directoryLabelsList); + } + + if (cmakeDirectoryLabels) { + cmSystemTools::ExpandListArgument(cmakeDirectoryLabels, + cmakeDirectoryLabelsList); + } + + if (!directoryLabelsList.empty() || !cmakeDirectoryLabelsList.empty()) { + fout << "# Directory labels\n"; + } + + for (std::vector<std::string>::const_iterator li = + directoryLabelsList.begin(); + li != directoryLabelsList.end(); ++li) { + fout << " " << *li << "\n"; + lj_target_labels.append(*li); + } + + for (std::vector<std::string>::const_iterator li = + cmakeDirectoryLabelsList.begin(); + li != cmakeDirectoryLabelsList.end(); ++li) { + fout << " " << *li << "\n"; + lj_target_labels.append(*li); + } + // List the source files with any per-source labels. fout << "# Source files and their labels\n"; std::vector<cmSourceFile*> sources; |