/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file LICENSE.rst or https://cmake.org/licensing for details. */ #pragma once #include "cmConfigure.h" // IWYU pragma: keep #include #include #include #include #include #include #include #include #include "cmTargetPropertyEntry.h" namespace cm { namespace GenEx { struct Context; struct Evaluation; } } struct cmGeneratorExpressionDAGChecker; class cmSourceFile; class cmGeneratorTarget; class cmGeneratorFileSet; class cmLocalGenerator; class cmGeneratorFileSets { public: using TargetPropertyEntry = cm::TargetPropertyEntry; cmGeneratorFileSets(cmGeneratorTarget* target, cmLocalGenerator* lg); ~cmGeneratorFileSets(); cmGeneratorFileSets(cmGeneratorFileSets const&) = delete; cmGeneratorFileSets& operator=(cmGeneratorFileSets const&) = delete; bool Empty() const { return this->FileSets.empty(); } std::vector GetFileSetTypes() const; std::vector GetInterfaceFileSetTypes() const; std::vector const& GetAllFileSets() const; std::vector const& GetFileSets( cm::string_view type) const; std::vector const& GetInterfaceFileSets( cm::string_view type) const; cmGeneratorFileSet const* GetFileSet(std::string const& name) const; std::unordered_set const& GetAllFileSetsForSource( std::string const& config, std::string const& file) const; std::unordered_set const& GetAllFileSetsForSource( std::string const& config, cmSourceFile const* sf) const; // returns the first FileSet of the set cmGeneratorFileSet const* GetFileSetForSource(std::string const& config, std::string const& file) const; cmGeneratorFileSet const* GetFileSetForSource(std::string const& config, cmSourceFile const* sf) const; std::vector> GetSources( cm::GenEx::Context const& context, cmGeneratorTarget const* target, cmGeneratorExpressionDAGChecker* dagChecker = nullptr) const; std::vector> GetSources( std::string type, cm::GenEx::Context const& context, cmGeneratorTarget const* target, cmGeneratorExpressionDAGChecker* dagChecker = nullptr) const; std::vector> GetInterfaceSources( cm::GenEx::Context const& context, cmGeneratorTarget const* target, cmGeneratorExpressionDAGChecker* dagChecker = nullptr) const; std::vector> GetInterfaceSources( std::string type, cm::GenEx::Context const& context, cmGeneratorTarget const* target, cmGeneratorExpressionDAGChecker* dagChecker = nullptr) const; std::string EvaluateInterfaceProperty( cm::string_view type, std::string const& prop, cm::GenEx::Evaluation* eval, cmGeneratorExpressionDAGChecker* dagCheckerParent) const; private: std::vector> GetSources( std::function include, cm::GenEx::Context const& context, cmGeneratorTarget const* target, cmGeneratorExpressionDAGChecker* dagChecker) const; // file sets indexed by name std::map> FileSets; std::vector AllFileSets; // list of private file sets indexed by type std::unordered_map> SelfFileSets; // list of interface file sets indexed by type std::unordered_map> InterfaceFileSets; mutable std::unordered_map MaybeInterfacePropertyExists; bool MaybeHaveInterfaceProperty(cm::string_view type, std::string const& prop, cm::GenEx::Evaluation* eval) const; struct InfoByConfig { bool BuiltCache = false; std::map> FileSetCache; std::map> InterfaceFileSetCache; }; mutable std::map Configs; void BuildInfoCache(std::string const& config) const; cmGeneratorTarget* Target; cmLocalGenerator* LocalGenerator; };