mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 21:40:15 +08:00
Add method to allow variables to be marked as used
This commit is contained in:
@@ -1735,6 +1735,11 @@ void cmMakefile::AddDefinition(const char* name, bool value)
|
||||
#endif
|
||||
}
|
||||
|
||||
void cmMakefile::MarkVariableAsUsed(const char* var)
|
||||
{
|
||||
this->Internal->VarUsageStack.top().insert(var);
|
||||
}
|
||||
|
||||
bool cmMakefile::VariableInitialized(const char* var) const
|
||||
{
|
||||
if(this->Internal->VarInitStack.top().find(var) != this->Internal->VarInitStack.top().end())
|
||||
|
@@ -61,6 +61,8 @@ public:
|
||||
unsigned int GetCacheMajorVersion();
|
||||
unsigned int GetCacheMinorVersion();
|
||||
|
||||
/* Mark a variable as used */
|
||||
void MarkVariableAsUsed(const char* var);
|
||||
/* return true if a variable has been initialized */
|
||||
bool VariableInitialized(const char* ) const;
|
||||
/* return true if a variable has been used */
|
||||
|
Reference in New Issue
Block a user