mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user