cmMakefile: Remove special handling of MACROS property.

This commit is contained in:
Stephen Kelly 2015-07-18 14:32:09 +02:00
parent 881613c4ab
commit 41bb831fc9
4 changed files with 5 additions and 32 deletions

View File

@ -41,7 +41,10 @@ bool cmGetCMakePropertyCommand
else if ( args[1] == "MACROS" ) else if ( args[1] == "MACROS" )
{ {
output.clear(); output.clear();
this->Makefile->GetListOfMacros(output); if (const char* macrosProp = this->Makefile->GetProperty("MACROS"))
{
output = macrosProp;
}
} }
else if ( args[1] == "COMPONENTS" ) else if ( args[1] == "COMPONENTS" )
{ {

View File

@ -211,7 +211,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)
{ {
mf.AddMacro(this->Args[0].c_str()); mf.AppendProperty("MACROS", this->Args[0].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;

View File

@ -3817,18 +3817,6 @@ cmVariableWatch *cmMakefile::GetVariableWatch() const
} }
#endif #endif
void cmMakefile::AddMacro(const char* name)
{
assert(name);
this->MacrosList.push_back(name);
}
void cmMakefile::GetListOfMacros(std::string& macros) const
{
assert(macros.empty());
macros = cmJoin(this->MacrosList, ";");
}
cmState *cmMakefile::GetState() const cmState *cmMakefile::GetState() const
{ {
return this->GetCMakeInstance()->GetState(); return this->GetCMakeInstance()->GetState();
@ -4265,11 +4253,6 @@ const char *cmMakefile::GetProperty(const std::string& prop,
output = cmJoin(this->GetDefinitions(), ";"); output = cmJoin(this->GetDefinitions(), ";");
return output.c_str(); return output.c_str();
} }
else if (prop == "MACROS")
{
this->GetListOfMacros(output);
return output.c_str();
}
else if (prop == "INCLUDE_DIRECTORIES") else if (prop == "INCLUDE_DIRECTORIES")
{ {
std::string sep; std::string sep;

View File

@ -655,12 +655,6 @@ public:
*/ */
cmSourceFile *GetSourceFileWithOutput(const std::string& outName) const; cmSourceFile *GetSourceFileWithOutput(const std::string& outName) const;
/**
* Add a macro to the list of macros. The arguments should be name of the
* macro and a documentation signature of it
*/
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);
@ -669,11 +663,6 @@ public:
*/ */
cmTest* GetTest(const std::string& testName) const; cmTest* GetTest(const std::string& testName) const;
/**
* Get a list of macros as a ; separated string
*/
void GetListOfMacros(std::string& macros) const;
/** /**
* Return a location of a file in cmake or custom modules directory * Return a location of a file in cmake or custom modules directory
*/ */
@ -909,8 +898,6 @@ private:
std::stack<int> LoopBlockCounter; std::stack<int> LoopBlockCounter;
std::vector<std::string> MacrosList;
mutable cmsys::RegularExpression cmDefineRegex; mutable cmsys::RegularExpression cmDefineRegex;
mutable cmsys::RegularExpression cmDefine01Regex; mutable cmsys::RegularExpression cmDefine01Regex;
mutable cmsys::RegularExpression cmAtVarRegex; mutable cmsys::RegularExpression cmAtVarRegex;