cmake: Add an option to control what files needs to be traced

Even in relatively small projects using `--trace` (and `--trace-expand`)
may produce a lot of output.  When developing a custom module usually
one is interested in output of only a few particular modules.

Add a `--trace-source=<file>` option to enable tracing only a subset of
source files.  The final output would be only from requested modules,
ignoring anything else not matched to given filename(s).
This commit is contained in:
Alex Turbov
2016-06-14 02:27:58 +07:00
committed by Brad King
parent 9e47255604
commit e63151ff54
10 changed files with 58 additions and 1 deletions
+10
View File
@@ -307,6 +307,14 @@ public:
void SetTrace(bool b) { this->Trace = b; }
bool GetTraceExpand() { return this->TraceExpand; }
void SetTraceExpand(bool b) { this->TraceExpand = b; }
void AddTraceSource(std::string const& file)
{
this->TraceOnlyThisSources.push_back(file);
}
std::vector<std::string> const& GetTraceSources() const
{
return this->TraceOnlyThisSources;
}
bool GetWarnUninitialized() { return this->WarnUninitialized; }
void SetWarnUninitialized(bool b) { this->WarnUninitialized = b; }
bool GetWarnUnused() { return this->WarnUnused; }
@@ -481,6 +489,8 @@ private:
cmState* State;
cmState::Snapshot CurrentSnapshot;
std::vector<std::string> TraceOnlyThisSources;
void UpdateConversionPathTable();
// Print a list of valid generators to stderr.