2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2010-08-25 14:07:25 +00:00
|
|
|
#ifndef cmTargetDepend_h
|
|
|
|
#define cmTargetDepend_h
|
|
|
|
|
2017-04-11 20:00:21 +00:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-09-01 18:05:48 +00:00
|
|
|
|
2016-11-05 20:40:14 +00:00
|
|
|
#include <set>
|
2010-08-25 14:07:25 +00:00
|
|
|
|
2015-06-06 11:08:17 +00:00
|
|
|
class cmGeneratorTarget;
|
2010-08-25 14:07:25 +00:00
|
|
|
|
|
|
|
/** One edge in the global target dependency graph.
|
|
|
|
It may be marked as a 'link' or 'util' edge or both. */
|
|
|
|
class cmTargetDepend
|
|
|
|
{
|
2015-06-06 11:08:17 +00:00
|
|
|
cmGeneratorTarget const* Target;
|
2010-08-25 14:07:25 +00:00
|
|
|
|
|
|
|
// The set order depends only on the Target, so we use
|
2017-11-02 23:14:55 +00:00
|
|
|
// mutable members to achieve a map with set syntax.
|
2010-08-25 14:07:25 +00:00
|
|
|
mutable bool Link;
|
|
|
|
mutable bool Util;
|
2016-05-16 14:34:04 +00:00
|
|
|
|
2010-08-25 14:07:25 +00:00
|
|
|
public:
|
2015-06-06 11:08:17 +00:00
|
|
|
cmTargetDepend(cmGeneratorTarget const* t)
|
2016-05-16 14:34:04 +00:00
|
|
|
: Target(t)
|
|
|
|
, Link(false)
|
|
|
|
, Util(false)
|
|
|
|
{
|
|
|
|
}
|
2015-06-06 11:08:17 +00:00
|
|
|
operator cmGeneratorTarget const*() const { return this->Target; }
|
|
|
|
cmGeneratorTarget const* operator->() const { return this->Target; }
|
|
|
|
cmGeneratorTarget const& operator*() const { return *this->Target; }
|
2017-04-21 22:41:09 +00:00
|
|
|
friend bool operator<(cmTargetDepend l, cmTargetDepend r)
|
2016-05-16 14:34:04 +00:00
|
|
|
{
|
|
|
|
return l.Target < r.Target;
|
|
|
|
}
|
2010-08-25 14:07:25 +00:00
|
|
|
void SetType(bool strong) const
|
2016-05-16 14:34:04 +00:00
|
|
|
{
|
|
|
|
if (strong) {
|
|
|
|
this->Util = true;
|
|
|
|
} else {
|
|
|
|
this->Link = true;
|
2010-08-25 14:07:25 +00:00
|
|
|
}
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2010-08-25 14:07:25 +00:00
|
|
|
bool IsLink() const { return this->Link; }
|
|
|
|
bool IsUtil() const { return this->Util; }
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Unordered set of (direct) dependencies of a target. */
|
2016-05-16 14:34:04 +00:00
|
|
|
class cmTargetDependSet : public std::set<cmTargetDepend>
|
|
|
|
{
|
|
|
|
};
|
2010-08-25 14:07:25 +00:00
|
|
|
|
|
|
|
#endif
|