[Cmake-commits] CMake branch, next, updated. v3.3.0-rc2-566-g1fa54ed
Stephen Kelly
steveire at gmail.com
Sun Jun 21 14:58:02 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 1fa54edcbf30fed8df32f30e0cc4466af6775436 (commit)
via 782657db48e0d5f0d33a19ad51678d36ddfa7ad5 (commit)
via a863c59f70a7556c010990a362e4d13792670148 (commit)
via 076760a63c665dd2269c74d415e323f55969f544 (commit)
via 569f4785371399628dd401e2522dccc54c73e34e (commit)
via f971ab04cfdcb73e1ac2b182caf302172aebe6a8 (commit)
from d536b447c65401b0a3e3383d4aed457d641d468f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fa54edcbf30fed8df32f30e0cc4466af6775436
commit 1fa54edcbf30fed8df32f30e0cc4466af6775436
Merge: d536b44 782657d
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 14:58:01 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jun 21 14:58:01 2015 -0400
Merge topic 'clean-up-cmListFileArgument' into next
782657db cmListFileArgument: Remove FilePath member.
a863c59f cmMakefile: Use GetExecutionFileStack method.
076760a6 cmMakefile: Add filename context to ExpandArguments.
569f4785 cmFunctionCommand: Store the FilePath when creating the prototype.
f971ab04 cmMacroCommand: Store the FilePath when creating the prototype.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=782657db48e0d5f0d33a19ad51678d36ddfa7ad5
commit 782657db48e0d5f0d33a19ad51678d36ddfa7ad5
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 23 23:43:37 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 21 20:57:26 2015 +0200
cmListFileArgument: Remove FilePath member.
It is now unused.
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 0d24ed5..591a2cd 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -426,8 +426,7 @@ int CCONV cmExecuteCommand(void *arg, const char *name,
{
// Assume all arguments are quoted.
lff.Arguments.push_back(
- cmListFileArgument(args[i], cmListFileArgument::Quoted,
- "[CMake-Plugin]", 0));
+ cmListFileArgument(args[i], cmListFileArgument::Quoted, 0));
}
cmExecutionStatus status;
return mf->ExecuteCommand(lff,status);
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 662f77d..b3576c3 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -176,17 +176,6 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
f->FilePath = this->GetStartingContext().FilePath;
mf.RecordPolicies(f->Policies);
- // Set the FilePath on the arguments to match the function since it is
- // not stored and the original values may be freed
- for (unsigned int i = 0; i < f->Functions.size(); ++i)
- {
- for (unsigned int j = 0; j < f->Functions[i].Arguments.size(); ++j)
- {
- f->Functions[i].Arguments[j].FilePath =
- f->Functions[i].FilePath.c_str();
- }
- }
-
std::string newName = "_" + this->Args[0];
mf.GetState()->RenameCommand(this->Args[0], newName);
mf.GetState()->AddCommand(f);
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index ca58314..006ca4c 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -234,8 +234,7 @@ bool cmListFile::ParseFile(const char* filename,
{
cmListFileFunction project;
project.Name = "PROJECT";
- cmListFileArgument prj("Project", cmListFileArgument::Unquoted,
- filename, 0);
+ cmListFileArgument prj("Project", cmListFileArgument::Unquoted, 0);
project.Arguments.push_back(prj);
this->Functions.insert(this->Functions.begin(),project);
}
@@ -375,7 +374,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
cmListFileArgument::Delimiter delim)
{
- cmListFileArgument a(token->text, delim, this->FileName, token->line);
+ cmListFileArgument a(token->text, delim, token->line);
this->Function.Arguments.push_back(a);
if(this->Separation == SeparationOkay)
{
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 4002d94..f5859ec 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -33,12 +33,11 @@ struct cmListFileArgument
Quoted,
Bracket
};
- cmListFileArgument(): Value(), Delim(Unquoted), FilePath(0), Line(0) {}
- cmListFileArgument(const cmListFileArgument& r):
- Value(r.Value), Delim(r.Delim), FilePath(r.FilePath), Line(r.Line) {}
- cmListFileArgument(const std::string& v, Delimiter d, const char* file,
- long line): Value(v), Delim(d),
- FilePath(file), Line(line) {}
+ cmListFileArgument(): Value(), Delim(Unquoted), Line(0) {}
+ cmListFileArgument(const cmListFileArgument& r)
+ : Value(r.Value), Delim(r.Delim), Line(r.Line) {}
+ cmListFileArgument(const std::string& v, Delimiter d, long line)
+ : Value(v), Delim(d), Line(line) {}
bool operator == (const cmListFileArgument& r) const
{
return (this->Value == r.Value) && (this->Delim == r.Delim);
@@ -49,7 +48,6 @@ struct cmListFileArgument
}
std::string Value;
Delimiter Delim;
- const char* FilePath;
long Line;
};
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index c3e67d7..0b945b2 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -139,10 +139,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
this->Functions[c].Arguments.begin();
k != this->Functions[c].Arguments.end(); ++k)
{
- // Set the FilePath on the arguments to match the function since it is
- // not stored and the original values may be freed
- k->FilePath = this->FilePath.c_str();
-
cmListFileArgument arg;
arg.Value = k->Value;
if(k->Delim != cmListFileArgument::Bracket)
@@ -173,7 +169,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
}
}
arg.Delim = k->Delim;
- arg.FilePath = k->FilePath;
arg.Line = k->Line;
newLFF.Arguments.push_back(arg);
}
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index 09cef5e..6521c04 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -49,21 +49,21 @@ static void cmVariableWatchCommandVariableAccessed(
newLFF.Arguments.clear();
newLFF.Arguments.push_back(
cmListFileArgument(variable, cmListFileArgument::Quoted,
- "unknown", 9999));
+ 9999));
newLFF.Arguments.push_back(
cmListFileArgument(accessString, cmListFileArgument::Quoted,
- "unknown", 9999));
+ 9999));
newLFF.Arguments.push_back(
cmListFileArgument(newValue?newValue:"", cmListFileArgument::Quoted,
- "unknown", 9999));
+ 9999));
newLFF.Arguments.push_back(
cmListFileArgument(currentListFile, cmListFileArgument::Quoted,
- "unknown", 9999));
+ 9999));
newLFF.Arguments.push_back(
cmListFileArgument(stack, cmListFileArgument::Quoted,
- "unknown", 9999));
+ 9999));
newLFF.Name = data->Command;
- newLFF.FilePath = "Some weird path";
+ newLFF.FilePath = "unknown";
newLFF.Line = 9999;
cmExecutionStatus status;
if(!makefile->ExecuteCommand(newLFF,status))
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a863c59f70a7556c010990a362e4d13792670148
commit a863c59f70a7556c010990a362e4d13792670148
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jun 13 19:18:28 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 21 20:57:25 2015 +0200
cmMakefile: Use GetExecutionFileStack method.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 72aa74c..a1b1a94 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -308,7 +308,7 @@ cmListFileContext cmMakefile::GetExecutionContext() const
void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
{
std::ostringstream msg;
- msg << lff.FilePath << "(" << lff.Line << "): ";
+ msg << this->GetExecutionFilePath() << "(" << lff.Line << "): ";
msg << lff.Name << "(";
for(std::vector<cmListFileArgument>::const_iterator i =
lff.Arguments.begin(); i != lff.Arguments.end(); ++i)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=076760a63c665dd2269c74d415e323f55969f544
commit 076760a63c665dd2269c74d415e323f55969f544
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 23 20:32:05 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 21 20:57:25 2015 +0200
cmMakefile: Add filename context to ExpandArguments.
The cmListFileArgument currently stores a FilePath for use in this
method. The filename is the same as the CMAKE_CURRENT_LIST_FILE,
except if executing a macro or function defined in another file.
Set the context filename when expanding the arguments of macros and
functions using the filename recorded when defining the prototype.
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 848cfd1..662f77d 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -215,7 +215,8 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf)
if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction"))
{
std::vector<std::string> expandedArguments;
- mf.ExpandArguments(lff.Arguments, expandedArguments);
+ mf.ExpandArguments(lff.Arguments, expandedArguments,
+ this->GetStartingContext().FilePath.c_str());
// if the endfunction has arguments then make sure
// they match the ones in the opening function command
if ((expandedArguments.empty() ||
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 7793dc4..c3e67d7 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -251,7 +251,8 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf)
if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endmacro"))
{
std::vector<std::string> expandedArguments;
- mf.ExpandArguments(lff.Arguments, expandedArguments);
+ mf.ExpandArguments(lff.Arguments, expandedArguments,
+ this->GetStartingContext().FilePath.c_str());
// if the endmacro has arguments make sure they
// match the arguments of the macro
if ((expandedArguments.empty() ||
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 63dbe27..72aa74c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3313,11 +3313,25 @@ bool cmMakefile::IsLoopBlock() const
return !this->LoopBlockCounter.empty() && this->LoopBlockCounter.top() > 0;
}
+std::string cmMakefile::GetExecutionFilePath() const
+{
+ if (this->CallStack.empty())
+ {
+ return std::string();
+ }
+ return this->CallStack.back().Context->FilePath;
+}
+
//----------------------------------------------------------------------------
bool cmMakefile::ExpandArguments(
std::vector<cmListFileArgument> const& inArgs,
- std::vector<std::string>& outArgs) const
+ std::vector<std::string>& outArgs, const char* filename) const
{
+ std::string efp = this->GetExecutionFilePath();
+ if (!filename)
+ {
+ filename = efp.c_str();
+ }
std::vector<cmListFileArgument>::const_iterator i;
std::string value;
outArgs.reserve(inArgs.size());
@@ -3332,8 +3346,7 @@ bool cmMakefile::ExpandArguments(
// Expand the variables in the argument.
value = i->Value;
this->ExpandVariablesInString(value, false, false, false,
- i->FilePath, i->Line,
- false, false);
+ filename, i->Line, false, false);
// If the argument is quoted, it should be one argument.
// Otherwise, it may be a list of arguments.
@@ -3352,8 +3365,13 @@ bool cmMakefile::ExpandArguments(
//----------------------------------------------------------------------------
bool cmMakefile::ExpandArguments(
std::vector<cmListFileArgument> const& inArgs,
- std::vector<cmExpandedCommandArgument>& outArgs) const
+ std::vector<cmExpandedCommandArgument>& outArgs, const char* filename) const
{
+ std::string efp = this->GetExecutionFilePath();
+ if (!filename)
+ {
+ filename = efp.c_str();
+ }
std::vector<cmListFileArgument>::const_iterator i;
std::string value;
outArgs.reserve(inArgs.size());
@@ -3368,8 +3386,7 @@ bool cmMakefile::ExpandArguments(
// Expand the variables in the argument.
value = i->Value;
this->ExpandVariablesInString(value, false, false, false,
- i->FilePath, i->Line,
- false, false);
+ filename, i->Line, false, false);
// If the argument is quoted, it should be one argument.
// Otherwise, it may be a list of arguments.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 86bde0c..8930b6d 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -662,10 +662,12 @@ public:
* variable replacement and list expansion.
*/
bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
- std::vector<std::string>& outArgs) const;
+ std::vector<std::string>& outArgs,
+ const char* filename = 0) const;
bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
- std::vector<cmExpandedCommandArgument>& outArgs) const;
+ std::vector<cmExpandedCommandArgument>& outArgs,
+ const char* filename = 0) const;
/**
* Get the instance
@@ -840,6 +842,8 @@ public:
const char* GetDefineFlagsCMP0059() const;
+ std::string GetExecutionFilePath() const;
+
protected:
// add link libraries and directories to the target
void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=569f4785371399628dd401e2522dccc54c73e34e
commit 569f4785371399628dd401e2522dccc54c73e34e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 23 22:21:08 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 21 20:31:28 2015 +0200
cmFunctionCommand: Store the FilePath when creating the prototype.
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index dc6d2d2..848cfd1 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -43,6 +43,7 @@ public:
newC->Args = this->Args;
newC->Functions = this->Functions;
newC->Policies = this->Policies;
+ newC->FilePath = this->FilePath;
return newC;
}
@@ -71,6 +72,7 @@ public:
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
cmPolicies::PolicyMap Policies;
+ std::string FilePath;
};
bool cmFunctionHelperCommand::InvokeInitialPass
@@ -171,6 +173,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
cmFunctionHelperCommand *f = new cmFunctionHelperCommand();
f->Args = this->Args;
f->Functions = this->Functions;
+ f->FilePath = this->GetStartingContext().FilePath;
mf.RecordPolicies(f->Policies);
// Set the FilePath on the arguments to match the function since it is
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f971ab04cfdcb73e1ac2b182caf302172aebe6a8
commit f971ab04cfdcb73e1ac2b182caf302172aebe6a8
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 23 21:28:30 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 21 20:31:27 2015 +0200
cmMacroCommand: Store the FilePath when creating the prototype.
Instead of setting it each time the macro is invoked.
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 028ab62..7793dc4 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -122,10 +122,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
sprintf(argvName,"${ARGV%i}",j);
argVs.push_back(argvName);
}
- if(!this->Functions.empty())
- {
- this->FilePath = this->Functions[0].FilePath;
- }
// Invoke all the functions that were collected in the block.
cmListFileFunction newLFF;
// for each function
@@ -225,6 +221,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
cmMacroHelperCommand *f = new cmMacroHelperCommand();
f->Args = this->Args;
f->Functions = this->Functions;
+ f->FilePath = this->GetStartingContext().FilePath;
mf.RecordPolicies(f->Policies);
std::string newName = "_" + this->Args[0];
mf.GetState()->RenameCommand(this->Args[0], newName);
-----------------------------------------------------------------------
Summary of changes:
Source/cmCPluginAPI.cxx | 3 +--
Source/cmFunctionCommand.cxx | 17 +++++------------
Source/cmListFileCache.cxx | 5 ++---
Source/cmListFileCache.h | 12 +++++-------
Source/cmMacroCommand.cxx | 13 +++----------
Source/cmMakefile.cxx | 31 ++++++++++++++++++++++++-------
Source/cmMakefile.h | 8 ++++++--
Source/cmVariableWatchCommand.cxx | 12 ++++++------
8 files changed, 52 insertions(+), 49 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list