From a8833639356204d4e3f0ff180c0ff102644a7bad Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 4 Nov 2021 13:26:48 -0400 Subject: 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 --- Source/cmLinkItem.cxx | 12 ++++++++---- 1 file 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; } -- cgit v0.12