1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
9 #include "cmListFileCache.h"
11 class cmGeneratorTarget;
13 /** One edge in the global target dependency graph.
14 It may be marked as a 'link' or 'util' edge or both. */
17 cmGeneratorTarget const* Target;
19 // The set order depends only on the Target, so we use
20 // mutable members to achieve a map with set syntax.
21 mutable bool Link = false;
22 mutable bool Util = false;
23 mutable bool Cross = false;
24 mutable cmListFileBacktrace Backtrace;
27 cmTargetDepend(cmGeneratorTarget const* t)
31 operator cmGeneratorTarget const*() const { return this->Target; }
32 cmGeneratorTarget const* operator->() const { return this->Target; }
33 cmGeneratorTarget const& operator*() const { return *this->Target; }
34 friend bool operator<(cmTargetDepend const& l, cmTargetDepend const& r)
36 return l.Target < r.Target;
38 void SetType(bool strong) const
46 void SetCross(bool cross) const { this->Cross = cross; }
47 void SetBacktrace(cmListFileBacktrace const& bt) const
51 bool IsLink() const { return this->Link; }
52 bool IsUtil() const { return this->Util; }
53 bool IsCross() const { return this->Cross; }
54 cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
57 /** Unordered set of (direct) dependencies of a target. */
58 class cmTargetDependSet : public std::set<cmTargetDepend>