cmMakefile: Split accessors for compile options and origins.
This commit is contained in:
parent
d6239507b2
commit
b2de25aded
|
@ -288,19 +288,15 @@ std::vector<cmValueWithOrigin> cmMakefile::GetIncludeDirectoriesEntries() const
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<cmValueWithOrigin> cmMakefile::GetCompileOptionsEntries() const
|
std::vector<std::string> cmMakefile::GetCompileOptionsEntries() const
|
||||||
{
|
{
|
||||||
std::vector<cmValueWithOrigin> entries;
|
return this->CompileOptionsEntries;
|
||||||
entries.reserve(this->CompileOptionsEntries.size());
|
}
|
||||||
std::vector<cmListFileBacktrace>::const_iterator btIt =
|
|
||||||
this->CompileOptionsEntryBacktraces.begin();
|
std::vector<cmListFileBacktrace>
|
||||||
for(std::vector<std::string>::const_iterator it =
|
cmMakefile::GetCompileOptionsBacktraces() const
|
||||||
this->CompileOptionsEntries.begin();
|
{
|
||||||
it != this->CompileOptionsEntries.end(); ++it, ++btIt)
|
return this->CompileOptionsEntryBacktraces;
|
||||||
{
|
|
||||||
entries.push_back(cmValueWithOrigin(*it, *btIt));
|
|
||||||
}
|
|
||||||
return entries;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> cmMakefile::GetCompileDefinitionsEntries() const
|
std::vector<std::string> cmMakefile::GetCompileDefinitionsEntries() const
|
||||||
|
|
|
@ -747,7 +747,8 @@ public:
|
||||||
void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
|
void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
|
||||||
|
|
||||||
std::vector<cmValueWithOrigin> GetIncludeDirectoriesEntries() const;
|
std::vector<cmValueWithOrigin> GetIncludeDirectoriesEntries() const;
|
||||||
std::vector<cmValueWithOrigin> GetCompileOptionsEntries() const;
|
std::vector<std::string> GetCompileOptionsEntries() const;
|
||||||
|
std::vector<cmListFileBacktrace> GetCompileOptionsBacktraces() const;
|
||||||
std::vector<std::string> GetCompileDefinitionsEntries() const;
|
std::vector<std::string> GetCompileDefinitionsEntries() const;
|
||||||
std::vector<cmListFileBacktrace> GetCompileDefinitionsBacktraces() const;
|
std::vector<cmListFileBacktrace> GetCompileDefinitionsBacktraces() const;
|
||||||
|
|
||||||
|
|
|
@ -416,13 +416,18 @@ void cmTarget::SetMakefile(cmMakefile* mf)
|
||||||
this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(),
|
this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(),
|
||||||
parentSystemIncludes.end());
|
parentSystemIncludes.end());
|
||||||
|
|
||||||
const std::vector<cmValueWithOrigin> parentOptions =
|
const std::vector<std::string> parentOptions =
|
||||||
this->Makefile->GetCompileOptionsEntries();
|
this->Makefile->GetCompileOptionsEntries();
|
||||||
|
const std::vector<cmListFileBacktrace> parentOptionsBts =
|
||||||
|
this->Makefile->GetCompileOptionsBacktraces();
|
||||||
|
|
||||||
for (std::vector<cmValueWithOrigin>::const_iterator it
|
std::vector<cmListFileBacktrace>::const_iterator btIt =
|
||||||
= parentOptions.begin(); it != parentOptions.end(); ++it)
|
parentOptionsBts.begin();
|
||||||
|
for (std::vector<std::string>::const_iterator it
|
||||||
|
= parentOptions.begin();
|
||||||
|
it != parentOptions.end(); ++it, ++btIt)
|
||||||
{
|
{
|
||||||
this->InsertCompileOption(*it);
|
this->InsertCompileOption(*it, *btIt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1940,17 +1945,18 @@ void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry,
|
void cmTarget::InsertCompileOption(std::string const& entry,
|
||||||
bool before)
|
cmListFileBacktrace const& bt,
|
||||||
|
bool before)
|
||||||
{
|
{
|
||||||
cmGeneratorExpression ge(entry.Backtrace);
|
cmGeneratorExpression ge(bt);
|
||||||
|
|
||||||
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
|
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
|
||||||
= before ? this->Internal->CompileOptionsEntries.begin()
|
= before ? this->Internal->CompileOptionsEntries.begin()
|
||||||
: this->Internal->CompileOptionsEntries.end();
|
: this->Internal->CompileOptionsEntries.end();
|
||||||
|
|
||||||
this->Internal->CompileOptionsEntries.insert(position,
|
this->Internal->CompileOptionsEntries.insert(position,
|
||||||
new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value)));
|
new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -574,8 +574,9 @@ public:
|
||||||
const std::string& language) const;
|
const std::string& language) const;
|
||||||
void InsertInclude(const cmValueWithOrigin &entry,
|
void InsertInclude(const cmValueWithOrigin &entry,
|
||||||
bool before = false);
|
bool before = false);
|
||||||
void InsertCompileOption(const cmValueWithOrigin &entry,
|
void InsertCompileOption(std::string const& entry,
|
||||||
bool before = false);
|
cmListFileBacktrace const& bt,
|
||||||
|
bool before = false);
|
||||||
void InsertCompileDefinition(std::string const& entry,
|
void InsertCompileDefinition(std::string const& entry,
|
||||||
cmListFileBacktrace const& bt);
|
cmListFileBacktrace const& bt);
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ bool cmTargetCompileOptionsCommand
|
||||||
bool, bool)
|
bool, bool)
|
||||||
{
|
{
|
||||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||||
cmValueWithOrigin entry(this->Join(content), lfbt);
|
tgt->InsertCompileOption(this->Join(content), lfbt);
|
||||||
tgt->InsertCompileOption(entry);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue