diff options
author | Brad King <brad.king@kitware.com> | 2021-11-04 17:26:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-11-04 17:41:13 (GMT) |
commit | a8833639356204d4e3f0ff180c0ff102644a7bad (patch) | |
tree | 0ef9eefe4c87406ae65b9727e6d87b8b383c0b57 /Source | |
parent | 16e24748c5092f19d53c80548083826f009aafc7 (diff) | |
download | CMake-a8833639356204d4e3f0ff180c0ff102644a7bad.zip CMake-a8833639356204d4e3f0ff180c0ff102644a7bad.tar.gz CMake-a8833639356204d4e3f0ff180c0ff102644a7bad.tar.bz2 |
Ninja Multi-Config: Fix internal cross-config target dependency ordering
In commit 7abc3d61ac (Ninja Multi-Config: Fix issue with framework
dependencies and Autogen, 2020-02-13, v3.17.0-rc2~18^2) the `cmLinkItem`
comparison operator was updated to order identical strings by the
cross-config boolean. We need to order identical targets that way too
in order to represent both a cross and non-cross dependency on the same
target.
Issue: #22855
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLinkItem.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx index 4e50d70..62e7ef4 100644 --- a/Source/cmLinkItem.cxx +++ b/Source/cmLinkItem.cxx @@ -32,7 +32,11 @@ bool operator<(cmLinkItem const& l, cmLinkItem const& r) { // Order among targets. if (l.Target && r.Target) { - return l.Target < r.Target; + if (l.Target != r.Target) { + return l.Target < r.Target; + } + // Order identical targets via cross-config. + return l.Cross < r.Cross; } // Order targets before strings. if (l.Target) { @@ -42,10 +46,10 @@ bool operator<(cmLinkItem const& l, cmLinkItem const& r) return false; } // Order among strings. - if (l.String < r.String) { - return true; + if (l.String != r.String) { + return l.String < r.String; } - // Order among cross-config. + // Order identical strings via cross-config. return l.Cross < r.Cross; } |