diff options
author | Brad King <brad.king@kitware.com> | 2018-09-06 22:22:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-10 11:51:44 (GMT) |
commit | f35be599612b788125d08a7c3e61d0fad3805bdd (patch) | |
tree | 49aa648c209a0e43674c3eba97016d1d167bb30c /Source/cmGeneratorExpressionDAGChecker.h | |
parent | 1b57f49586afc9e8663d5e146732b1cd0597e7ef (diff) | |
download | CMake-f35be599612b788125d08a7c3e61d0fad3805bdd.zip CMake-f35be599612b788125d08a7c3e61d0fad3805bdd.tar.gz CMake-f35be599612b788125d08a7c3e61d0fad3805bdd.tar.bz2 |
Fix transitive usage requirements through same-name imported targets
If two imported targets in different directories have the same name we
should still be able to propagate transitive usage requirements from
both. Fix the DAG checker to work with target pointers instead of
target names since the pointers will not be duplicated even if the names
are.
Fixes: #18345
Diffstat (limited to 'Source/cmGeneratorExpressionDAGChecker.h')
-rw-r--r-- | Source/cmGeneratorExpressionDAGChecker.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index cd23904..8b1697b 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -13,6 +13,7 @@ struct GeneratorExpressionContent; struct cmGeneratorExpressionContext; +class cmGeneratorTarget; #define CM_SELECT_BOTH(F, A1, A2) F(A1, A2) #define CM_SELECT_FIRST(F, A1, A2) F(A1) @@ -41,11 +42,11 @@ struct cmGeneratorExpressionContext; struct cmGeneratorExpressionDAGChecker { cmGeneratorExpressionDAGChecker(const cmListFileBacktrace& backtrace, - const std::string& target, + cmGeneratorTarget const* target, const std::string& property, const GeneratorExpressionContent* content, cmGeneratorExpressionDAGChecker* parent); - cmGeneratorExpressionDAGChecker(const std::string& target, + cmGeneratorExpressionDAGChecker(cmGeneratorTarget const* target, const std::string& property, const GeneratorExpressionContent* content, cmGeneratorExpressionDAGChecker* parent); @@ -64,7 +65,7 @@ struct cmGeneratorExpressionDAGChecker const std::string& expr); bool EvaluatingGenexExpression(); - bool EvaluatingLinkLibraries(const char* tgt = nullptr); + bool EvaluatingLinkLibraries(cmGeneratorTarget const* tgt = nullptr); #define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) bool METHOD() const; @@ -75,7 +76,7 @@ struct cmGeneratorExpressionDAGChecker bool GetTransitivePropertiesOnly(); void SetTransitivePropertiesOnly() { this->TransitivePropertiesOnly = true; } - std::string TopTarget() const; + cmGeneratorTarget const* TopTarget() const; private: Result CheckGraph() const; @@ -83,9 +84,9 @@ private: private: const cmGeneratorExpressionDAGChecker* const Parent; - const std::string Target; + cmGeneratorTarget const* Target; const std::string Property; - std::map<std::string, std::set<std::string>> Seen; + std::map<cmGeneratorTarget const*, std::set<std::string>> Seen; const GeneratorExpressionContent* const Content; const cmListFileBacktrace Backtrace; Result CheckResult; |