Merge topic 'minor-cleanups'
c021f59c
cmMakefile: Store macro list in a vector not in a map.2d130896
cmMakefile: Fix list of macros generation.f1969234
cmFunctionCommand: Remove ineffectual code.1116698a
cmTarget: Don't needlessly clear vectors in the destructor.
This commit is contained in:
commit
6dc9a627b6
|
@ -175,11 +175,6 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
|
||||||
// if this is the endfunction for this function then execute
|
// if this is the endfunction for this function then execute
|
||||||
if (!this->Depth)
|
if (!this->Depth)
|
||||||
{
|
{
|
||||||
std::string name = this->Args[0];
|
|
||||||
name += "( ";
|
|
||||||
name += cmJoin(this->Args, " ");
|
|
||||||
name += " )";
|
|
||||||
|
|
||||||
// create a new command and add it to cmake
|
// create a new command and add it to cmake
|
||||||
cmFunctionHelperCommand *f = new cmFunctionHelperCommand();
|
cmFunctionHelperCommand *f = new cmFunctionHelperCommand();
|
||||||
f->Args = this->Args;
|
f->Args = this->Args;
|
||||||
|
|
|
@ -39,6 +39,7 @@ bool cmGetCMakePropertyCommand
|
||||||
}
|
}
|
||||||
else if ( args[1] == "MACROS" )
|
else if ( args[1] == "MACROS" )
|
||||||
{
|
{
|
||||||
|
output.clear();
|
||||||
this->Makefile->GetListOfMacros(output);
|
this->Makefile->GetListOfMacros(output);
|
||||||
}
|
}
|
||||||
else if ( args[1] == "COMPONENTS" )
|
else if ( args[1] == "COMPONENTS" )
|
||||||
|
|
|
@ -224,15 +224,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
|
||||||
// if this is the endmacro for this macro then execute
|
// if this is the endmacro for this macro then execute
|
||||||
if (!this->Depth)
|
if (!this->Depth)
|
||||||
{
|
{
|
||||||
std::string name = this->Args[0];
|
mf.AddMacro(this->Args[0].c_str());
|
||||||
name += "(";
|
|
||||||
if (!this->Args.empty())
|
|
||||||
{
|
|
||||||
name += " ";
|
|
||||||
name += cmJoin(this->Args, " ");
|
|
||||||
}
|
|
||||||
name += " )";
|
|
||||||
mf.AddMacro(this->Args[0].c_str(), name.c_str());
|
|
||||||
// create a new command and add it to cmake
|
// create a new command and add it to cmake
|
||||||
cmMacroHelperCommand *f = new cmMacroHelperCommand();
|
cmMacroHelperCommand *f = new cmMacroHelperCommand();
|
||||||
f->Args = this->Args;
|
f->Args = this->Args;
|
||||||
|
|
|
@ -143,7 +143,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
|
||||||
|
|
||||||
this->LocalGenerator = mf.LocalGenerator;
|
this->LocalGenerator = mf.LocalGenerator;
|
||||||
this->FunctionBlockers = mf.FunctionBlockers;
|
this->FunctionBlockers = mf.FunctionBlockers;
|
||||||
this->MacrosMap = mf.MacrosMap;
|
this->MacrosList = mf.MacrosList;
|
||||||
this->SubDirectoryOrder = mf.SubDirectoryOrder;
|
this->SubDirectoryOrder = mf.SubDirectoryOrder;
|
||||||
this->Properties = mf.Properties;
|
this->Properties = mf.Properties;
|
||||||
this->PreOrder = mf.PreOrder;
|
this->PreOrder = mf.PreOrder;
|
||||||
|
@ -3715,26 +3715,16 @@ cmVariableWatch *cmMakefile::GetVariableWatch() const
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void cmMakefile::AddMacro(const char* name, const char* signature)
|
void cmMakefile::AddMacro(const char* name)
|
||||||
{
|
{
|
||||||
if ( !name || !signature )
|
assert(name);
|
||||||
{
|
this->MacrosList.push_back(name);
|
||||||
return;
|
|
||||||
}
|
|
||||||
this->MacrosMap[name] = signature;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::GetListOfMacros(std::string& macros) const
|
void cmMakefile::GetListOfMacros(std::string& macros) const
|
||||||
{
|
{
|
||||||
StringStringMap::const_iterator it;
|
assert(macros.empty());
|
||||||
macros = "";
|
macros = cmJoin(this->MacrosList, ";");
|
||||||
const char* sep = "";
|
|
||||||
for ( it = this->MacrosMap.begin(); it != this->MacrosMap.end(); ++it )
|
|
||||||
{
|
|
||||||
macros += sep;
|
|
||||||
macros += it->first;
|
|
||||||
sep = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmCacheManager *cmMakefile::GetCacheManager() const
|
cmCacheManager *cmMakefile::GetCacheManager() const
|
||||||
|
|
|
@ -841,7 +841,7 @@ public:
|
||||||
* Add a macro to the list of macros. The arguments should be name of the
|
* Add a macro to the list of macros. The arguments should be name of the
|
||||||
* macro and a documentation signature of it
|
* macro and a documentation signature of it
|
||||||
*/
|
*/
|
||||||
void AddMacro(const char* name, const char* signature);
|
void AddMacro(const char* name);
|
||||||
|
|
||||||
///! Add a new cmTest to the list of tests for this makefile.
|
///! Add a new cmTest to the list of tests for this makefile.
|
||||||
cmTest* CreateTest(const std::string& testName);
|
cmTest* CreateTest(const std::string& testName);
|
||||||
|
@ -1065,8 +1065,7 @@ private:
|
||||||
|
|
||||||
std::stack<int> LoopBlockCounter;
|
std::stack<int> LoopBlockCounter;
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> StringStringMap;
|
std::vector<std::string> MacrosList;
|
||||||
StringStringMap MacrosMap;
|
|
||||||
|
|
||||||
std::map<std::string, bool> SubDirectoryOrder;
|
std::map<std::string, bool> SubDirectoryOrder;
|
||||||
|
|
||||||
|
|
|
@ -6872,11 +6872,11 @@ cmTargetInternalPointer
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmTargetInternalPointer::~cmTargetInternalPointer()
|
cmTargetInternalPointer::~cmTargetInternalPointer()
|
||||||
{
|
{
|
||||||
deleteAndClear(this->Pointer->IncludeDirectoriesEntries);
|
cmDeleteAll(this->Pointer->IncludeDirectoriesEntries);
|
||||||
deleteAndClear(this->Pointer->CompileOptionsEntries);
|
cmDeleteAll(this->Pointer->CompileOptionsEntries);
|
||||||
deleteAndClear(this->Pointer->CompileFeaturesEntries);
|
cmDeleteAll(this->Pointer->CompileFeaturesEntries);
|
||||||
deleteAndClear(this->Pointer->CompileDefinitionsEntries);
|
cmDeleteAll(this->Pointer->CompileDefinitionsEntries);
|
||||||
deleteAndClear(this->Pointer->SourceEntries);
|
cmDeleteAll(this->Pointer->SourceEntries);
|
||||||
delete this->Pointer;
|
delete this->Pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue