2016-09-27 22:01:08 +03: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 18:07:25 +04:00
|
|
|
#ifndef cmTargetDepend_h
|
|
|
|
#define cmTargetDepend_h
|
|
|
|
|
2016-09-01 21:05:48 +03:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2010-08-25 18:07:25 +04:00
|
|
|
#include "cmStandardIncludes.h"
|
|
|
|
|
2015-06-06 14:08:17 +03:00
|
|
|
class cmGeneratorTarget;
|
2010-08-25 18:07:25 +04: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 14:08:17 +03:00
|
|
|
cmGeneratorTarget const* Target;
|
2010-08-25 18:07:25 +04:00
|
|
|
|
|
|
|
// The set order depends only on the Target, so we use
|
|
|
|
// mutable members to acheive a map with set syntax.
|
|
|
|
mutable bool Link;
|
|
|
|
mutable bool Util;
|
2016-05-16 17:34:04 +03:00
|
|
|
|
2010-08-25 18:07:25 +04:00
|
|
|
public:
|
2015-06-06 14:08:17 +03:00
|
|
|
cmTargetDepend(cmGeneratorTarget const* t)
|
2016-05-16 17:34:04 +03:00
|
|
|
: Target(t)
|
|
|
|
, Link(false)
|
|
|
|
, Util(false)
|
|
|
|
{
|
|
|
|
}
|
2015-06-06 14:08:17 +03:00
|
|
|
operator cmGeneratorTarget const*() const { return this->Target; }
|
|
|
|
cmGeneratorTarget const* operator->() const { return this->Target; }
|
|
|
|
cmGeneratorTarget const& operator*() const { return *this->Target; }
|
2016-05-16 17:34:04 +03:00
|
|
|
friend bool operator<(cmTargetDepend const& l, cmTargetDepend const& r)
|
|
|
|
{
|
|
|
|
return l.Target < r.Target;
|
|
|
|
}
|
2010-08-25 18:07:25 +04:00
|
|
|
void SetType(bool strong) const
|
2016-05-16 17:34:04 +03:00
|
|
|
{
|
|
|
|
if (strong) {
|
|
|
|
this->Util = true;
|
|
|
|
} else {
|
|
|
|
this->Link = true;
|
2010-08-25 18:07:25 +04:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2010-08-25 18:07:25 +04:00
|
|
|
bool IsLink() const { return this->Link; }
|
|
|
|
bool IsUtil() const { return this->Util; }
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Unordered set of (direct) dependencies of a target. */
|
2016-05-16 17:34:04 +03:00
|
|
|
class cmTargetDependSet : public std::set<cmTargetDepend>
|
|
|
|
{
|
|
|
|
};
|
2010-08-25 18:07:25 +04:00
|
|
|
|
|
|
|
#endif
|