diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-02-01 15:28:21 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-02-01 15:55:35 (GMT) |
commit | 2ddf3f4467bdd600027dd3532515d05d44996871 (patch) | |
tree | 204493c5498596b8e14b196d47adbc4da4dc2acf /Source/cmSourceFile.cxx | |
parent | b9d44fc35081a3354429137dff09a8959d8a2a92 (diff) | |
download | CMake-2ddf3f4467bdd600027dd3532515d05d44996871.zip CMake-2ddf3f4467bdd600027dd3532515d05d44996871.tar.gz CMake-2ddf3f4467bdd600027dd3532515d05d44996871.tar.bz2 |
cmSourceFile: Add IsGenerated method
All cmSourceFiles are checked at least once whether they're `GENERATED` or not.
This adds a convenience method `GetIsGenerated` that returns a private
boolean cache variable `IsGenerated`. `IsGenerated` is updated every time the
`GENERATED` property is written.
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 5ac902f..cc72fb0 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -17,8 +17,6 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name, cmSourceFileLocationKind kind) : Location(mf, name, kind) { - this->CustomCommand = nullptr; - this->FindFullPathFailed = false; } cmSourceFile::~cmSourceFile() @@ -244,12 +242,22 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc) void cmSourceFile::SetProperty(const std::string& prop, const char* value) { this->Properties.SetProperty(prop, value); + + // Update IsGenerated flag + if (prop == propGENERATED) { + this->IsGenerated = cmSystemTools::IsOn(value); + } } void cmSourceFile::AppendProperty(const std::string& prop, const char* value, bool asString) { this->Properties.AppendProperty(prop, value, asString); + + // Update IsGenerated flag + if (prop == propGENERATED) { + this->IsGenerated = this->GetPropertyAsBool(propGENERATED); + } } const char* cmSourceFile::GetPropertyForUser(const std::string& prop) |