mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 22:37:30 +08:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user