From 0795d25b78d5b7682aea091d260eaf1bca7afd0a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 11 Jan 2018 14:46:38 -0500 Subject: cmVisualStudio10TargetGenerator: Factor out include dir computation --- Source/cmVisualStudio10TargetGenerator.cxx | 19 +++++++++++++------ Source/cmVisualStudio10TargetGenerator.h | 3 +++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index f997a11..7074624 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2319,6 +2319,18 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental( } } +std::vector cmVisualStudio10TargetGenerator::GetIncludes( + std::string const& config, std::string const& lang) const +{ + std::vector includes; + this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget, + lang, config); + for (std::string& i : includes) { + this->ConvertToWindowsSlash(i); + } + return includes; +} + bool cmVisualStudio10TargetGenerator::ComputeClOptions() { for (std::string const& i : this->Configurations) { @@ -3478,12 +3490,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() return; } for (std::string const& i : this->Configurations) { - std::vector includes; - this->LocalGenerator->GetIncludeDirectories(includes, - this->GeneratorTarget, "C", i); - for (std::string& ii : includes) { - this->ConvertToWindowsSlash(ii); - } + std::vector const includes = this->GetIncludes(i, "C"); this->WritePlatformConfigTag("ItemDefinitionGroup", i, 1); *this->BuildFileStream << "\n"; // output cl compile flags diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index fb24f1a..3f56959 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -90,6 +90,9 @@ private: void WriteTargetSpecificReferences(); void WriteTargetsFileReferences(); + std::vector GetIncludes(std::string const& config, + std::string const& lang) const; + bool ComputeClOptions(); bool ComputeClOptions(std::string const& configName); void WriteClOptions(std::string const& config, -- cgit v0.12