diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-07-19 09:08:38 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-07-24 09:11:25 (GMT) |
commit | f2ba968ef2a1c46e117dcd8eec34a55775f3d5f4 (patch) | |
tree | 8fe55d2760291f1ab684afbb052fcc8aee266872 /Source/cmMakefile.cxx | |
parent | 9b5cc4253135c7811936b05525e013e04a390d02 (diff) | |
download | CMake-f2ba968ef2a1c46e117dcd8eec34a55775f3d5f4.zip CMake-f2ba968ef2a1c46e117dcd8eec34a55775f3d5f4.tar.gz CMake-f2ba968ef2a1c46e117dcd8eec34a55775f3d5f4.tar.bz2 |
cmMakefile: Simplify and rename AddDefinitionBool
This simplifies the `cmMakefile::AddDefinition` method with bool value
overload to call the string based `cmMakefile::AddDefinition` method
with either an "ON" or "OFF" string.
Also the method is renamed to `cmMakefile::AddDefinitionBool`
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3177adc..1867809 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1803,6 +1803,11 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value) #endif } +void cmMakefile::AddDefinitionBool(const std::string& name, bool value) +{ + this->AddDefinition(name, value ? "ON" : "OFF"); +} + void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, const char* doc, cmStateEnums::CacheEntryType type, @@ -1848,23 +1853,6 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, this->StateSnapshot.RemoveDefinition(name); } -void cmMakefile::AddDefinition(const std::string& name, bool value) -{ - if (this->VariableInitialized(name)) { - this->LogUnused("changing definition", name); - } - - this->StateSnapshot.SetDefinition(name, value ? "ON" : "OFF"); - -#ifdef CMAKE_BUILD_WITH_CMAKE - cmVariableWatch* vv = this->GetVariableWatch(); - if (vv) { - vv->VariableAccessed(name, cmVariableWatch::VARIABLE_MODIFIED_ACCESS, - value ? "ON" : "OFF", this); - } -#endif -} - void cmMakefile::CheckForUnusedVariables() const { if (!this->WarnUnused) { |