mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 04:40:18 -05:00
cmLocalGenerator: Remove unused IncludePathStyle infrastructure
It is unused since commit c564a3e3ff (Ninja: Always compile sources
using absolute paths, 2021-05-19, v3.21.0-rc1~129^2), which left
behind a FIXME comment to eventually remove it.
This commit is contained in:
@@ -435,8 +435,7 @@ std::string cmExtraSublimeTextGenerator::ComputeIncludes(
|
|||||||
lg->GetIncludeDirectories(includes, target, language, config);
|
lg->GetIncludeDirectories(includes, target, language, config);
|
||||||
|
|
||||||
std::string includesString =
|
std::string includesString =
|
||||||
lg->GetIncludeFlags(includes, target, language, config, false,
|
lg->GetIncludeFlags(includes, target, language, config, false);
|
||||||
cmLocalGenerator::IncludePathStyle::Absolute);
|
|
||||||
|
|
||||||
return includesString;
|
return includesString;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -835,16 +835,14 @@ cmValue cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmLocalGenerator::ConvertToIncludeReference(
|
std::string cmLocalGenerator::ConvertToIncludeReference(
|
||||||
std::string const& path, IncludePathStyle pathStyle, OutputFormat format)
|
std::string const& path, OutputFormat format)
|
||||||
{
|
{
|
||||||
static_cast<void>(pathStyle);
|
|
||||||
return this->ConvertToOutputForExisting(path, format);
|
return this->ConvertToOutputForExisting(path, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmLocalGenerator::GetIncludeFlags(
|
std::string cmLocalGenerator::GetIncludeFlags(
|
||||||
std::vector<std::string> const& includeDirs, cmGeneratorTarget* target,
|
std::vector<std::string> const& includeDirs, cmGeneratorTarget* target,
|
||||||
std::string const& lang, std::string const& config, bool forResponseFile,
|
std::string const& lang, std::string const& config, bool forResponseFile)
|
||||||
IncludePathStyle pathStyle)
|
|
||||||
{
|
{
|
||||||
if (lang.empty()) {
|
if (lang.empty()) {
|
||||||
return "";
|
return "";
|
||||||
@@ -923,8 +921,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
|
|||||||
}
|
}
|
||||||
flagUsed = true;
|
flagUsed = true;
|
||||||
}
|
}
|
||||||
std::string includePath =
|
std::string includePath = this->ConvertToIncludeReference(i, shellFormat);
|
||||||
this->ConvertToIncludeReference(i, pathStyle, shellFormat);
|
|
||||||
if (quotePaths && !includePath.empty() && includePath.front() != '\"') {
|
if (quotePaths && !includePath.empty() && includePath.front() != '\"') {
|
||||||
includeFlags << "\"";
|
includeFlags << "\"";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,18 +179,12 @@ public:
|
|||||||
bool AppendLWYUFlags(std::string& flags, const cmGeneratorTarget* target,
|
bool AppendLWYUFlags(std::string& flags, const cmGeneratorTarget* target,
|
||||||
const std::string& lang);
|
const std::string& lang);
|
||||||
|
|
||||||
enum class IncludePathStyle
|
|
||||||
{
|
|
||||||
Default,
|
|
||||||
Absolute,
|
|
||||||
};
|
|
||||||
|
|
||||||
//! Get the include flags for the current makefile and language
|
//! Get the include flags for the current makefile and language
|
||||||
std::string GetIncludeFlags(
|
std::string GetIncludeFlags(std::vector<std::string> const& includes,
|
||||||
std::vector<std::string> const& includes, cmGeneratorTarget* target,
|
cmGeneratorTarget* target,
|
||||||
std::string const& lang, std::string const& config,
|
std::string const& lang,
|
||||||
bool forResponseFile = false,
|
std::string const& config,
|
||||||
IncludePathStyle pathStyle = IncludePathStyle::Default);
|
bool forResponseFile = false);
|
||||||
|
|
||||||
using GeneratorTargetVector =
|
using GeneratorTargetVector =
|
||||||
std::vector<std::unique_ptr<cmGeneratorTarget>>;
|
std::vector<std::unique_ptr<cmGeneratorTarget>>;
|
||||||
@@ -526,12 +520,11 @@ public:
|
|||||||
cmValue GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop);
|
cmValue GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// The default implementation ignores the IncludePathStyle and always
|
// The default implementation converts to a Windows shortpath to
|
||||||
// uses absolute paths. A generator may override this to use relative
|
// help older toolchains handle spaces and such. A generator may
|
||||||
// paths in some cases.
|
// override this to avoid that conversion.
|
||||||
virtual std::string ConvertToIncludeReference(
|
virtual std::string ConvertToIncludeReference(
|
||||||
std::string const& path, IncludePathStyle pathStyle,
|
std::string const& path, cmOutputConverter::OutputFormat format);
|
||||||
cmOutputConverter::OutputFormat format);
|
|
||||||
|
|
||||||
//! put all the libraries for a target on into the given stream
|
//! put all the libraries for a target on into the given stream
|
||||||
void OutputLinkLibraries(cmComputeLinkInformation* pcli,
|
void OutputLinkLibraries(cmComputeLinkInformation* pcli,
|
||||||
|
|||||||
@@ -205,11 +205,8 @@ cmGlobalNinjaGenerator* cmLocalNinjaGenerator::GetGlobalNinjaGenerator()
|
|||||||
// Virtual protected methods.
|
// Virtual protected methods.
|
||||||
|
|
||||||
std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
|
std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
|
||||||
std::string const& path, IncludePathStyle pathStyle,
|
std::string const& path, cmOutputConverter::OutputFormat format)
|
||||||
cmOutputConverter::OutputFormat format)
|
|
||||||
{
|
{
|
||||||
// FIXME: Remove IncludePathStyle infrastructure. It is no longer used.
|
|
||||||
static_cast<void>(pathStyle);
|
|
||||||
return this->ConvertToOutputFormat(path, format);
|
return this->ConvertToOutputFormat(path, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
#include "cmListFileCache.h"
|
#include "cmListFileCache.h"
|
||||||
#include "cmLocalCommonGenerator.h"
|
#include "cmLocalCommonGenerator.h"
|
||||||
#include "cmLocalGenerator.h"
|
|
||||||
#include "cmNinjaTypes.h"
|
#include "cmNinjaTypes.h"
|
||||||
#include "cmOutputConverter.h"
|
#include "cmOutputConverter.h"
|
||||||
|
|
||||||
@@ -93,8 +92,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string ConvertToIncludeReference(
|
std::string ConvertToIncludeReference(
|
||||||
std::string const& path, IncludePathStyle pathStyle,
|
std::string const& path, cmOutputConverter::OutputFormat format) override;
|
||||||
cmOutputConverter::OutputFormat format) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cmGeneratedFileStream& GetImplFileStream(const std::string& config) const;
|
cmGeneratedFileStream& GetImplFileStream(const std::string& config) const;
|
||||||
|
|||||||
@@ -263,10 +263,7 @@ void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags,
|
|||||||
language, config);
|
language, config);
|
||||||
// Add include directory flags.
|
// Add include directory flags.
|
||||||
std::string includeFlags = this->LocalGenerator->GetIncludeFlags(
|
std::string includeFlags = this->LocalGenerator->GetIncludeFlags(
|
||||||
includes, this->GeneratorTarget, language, config, false,
|
includes, this->GeneratorTarget, language, config, false);
|
||||||
// full include paths for RC needed by cmcldeps
|
|
||||||
language == "RC" ? cmLocalGenerator::IncludePathStyle::Absolute
|
|
||||||
: cmLocalGenerator::IncludePathStyle::Default);
|
|
||||||
if (this->GetGlobalGenerator()->IsGCCOnWindows()) {
|
if (this->GetGlobalGenerator()->IsGCCOnWindows()) {
|
||||||
std::replace(includeFlags.begin(), includeFlags.end(), '\\', '/');
|
std::replace(includeFlags.begin(), includeFlags.end(), '\\', '/');
|
||||||
}
|
}
|
||||||
@@ -325,8 +322,7 @@ std::string cmNinjaTargetGenerator::ComputeIncludes(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string includesString = this->LocalGenerator->GetIncludeFlags(
|
std::string includesString = this->LocalGenerator->GetIncludeFlags(
|
||||||
includes, this->GeneratorTarget, language, config, false,
|
includes, this->GeneratorTarget, language, config, false);
|
||||||
cmLocalGenerator::IncludePathStyle::Absolute);
|
|
||||||
this->LocalGenerator->AppendFlags(includesString,
|
this->LocalGenerator->AppendFlags(includesString,
|
||||||
this->GetIncludes(language, config));
|
this->GetIncludes(language, config));
|
||||||
|
|
||||||
@@ -1413,8 +1409,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
|||||||
cmSystemTools::GetParentDirectory(source->GetFullPath()));
|
cmSystemTools::GetParentDirectory(source->GetFullPath()));
|
||||||
|
|
||||||
std::string sourceDirectoryFlag = this->LocalGenerator->GetIncludeFlags(
|
std::string sourceDirectoryFlag = this->LocalGenerator->GetIncludeFlags(
|
||||||
sourceDirectory, this->GeneratorTarget, language, config, false,
|
sourceDirectory, this->GeneratorTarget, language, config, false);
|
||||||
cmLocalGenerator::IncludePathStyle::Default);
|
|
||||||
|
|
||||||
vars["INCLUDES"] = cmStrCat(sourceDirectoryFlag, ' ', vars["INCLUDES"]);
|
vars["INCLUDES"] = cmStrCat(sourceDirectoryFlag, ' ', vars["INCLUDES"]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user