summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSourceFile.h')
-rw-r--r--Source/cmSourceFile.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 3ad2664..94b5cc8 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -20,18 +20,18 @@ class cmMakefile;
/** \class cmSourceFile
* \brief Represent a class loaded from a makefile.
*
- * cmSourceFile is represents a class loaded from
- * a makefile.
+ * cmSourceFile represents a class loaded from a makefile.
*/
class cmSourceFile
{
public:
/**
- * Construct with the makefile storing the source and the initial
- * name referencing it.
+ * Construct with the makefile storing the source and the initial name
+ * referencing it. If it shall be marked as generated, this source file's
+ * kind is assumed to be known, regardless of the given value.
*/
cmSourceFile(
- cmMakefile* mf, const std::string& name,
+ cmMakefile* mf, const std::string& name, bool generated,
cmSourceFileLocationKind kind = cmSourceFileLocationKind::Ambiguous);
/**
@@ -54,9 +54,29 @@ public:
command like get_property or get_source_file_property. */
cmProp GetPropertyForUser(const std::string& prop);
- //! Checks is the GENERATED property is set and true
- /// @return Equivalent to GetPropertyAsBool("GENERATED")
- bool GetIsGenerated() const { return this->IsGenerated; }
+ /// Marks this file as generated
+ /**
+ * This stores this file's path in the global table for all generated source
+ * files.
+ */
+ void MarkAsGenerated();
+ enum class CheckScope
+ {
+ Global,
+ GlobalAndLocal
+ };
+ /// Determines if this source file is marked as generated.
+ /**
+ * This will check if this file's path is stored in the global table of all
+ * generated source files. If that is not the case and checkScope is set to
+ * GlobalAndLocal the value of the possibly existing local GENERATED property
+ * is returned instead.
+ * @param checkScope Determines if alternatively for backwards-compatibility
+ * a local GENERATED property should be considered, too.
+ * @return true if this source file is marked as generated, otherwise false.
+ */
+ bool GetIsGenerated(
+ CheckScope checkScope = CheckScope::GlobalAndLocal) const;
const std::vector<BT<std::string>>& GetCompileOptions() const
{