};
inline bool operator==(const Target &LHS, const Target &RHS) {
- return std::tie(LHS.Arch, LHS.Platform) == std::tie(RHS.Arch, RHS.Platform);
+ bool CrossLinkMatch =
+ std::tie(LHS.Arch, LHS.Platform) == std::tie(RHS.Arch, RHS.Platform);
+ // Ignore potential mismatches due to missing deployment versions.
+ if (LHS.MinDeployment.empty() || RHS.MinDeployment.empty())
+ return CrossLinkMatch;
+ return CrossLinkMatch && LHS.MinDeployment == RHS.MinDeployment;
}
inline bool operator!=(const Target &LHS, const Target &RHS) {
- return std::tie(LHS.Arch, LHS.Platform) != std::tie(RHS.Arch, RHS.Platform);
+ return !(LHS == RHS);
}
inline bool operator<(const Target &LHS, const Target &RHS) {
- return std::tie(LHS.Arch, LHS.Platform) < std::tie(RHS.Arch, RHS.Platform);
+ return std::tie(LHS.Arch, LHS.Platform, LHS.MinDeployment) <
+ std::tie(RHS.Arch, RHS.Platform, RHS.MinDeployment);
}
inline bool operator==(const Target &LHS, const Architecture &RHS) {
TargetList AllTargets = {
Target(AK_x86_64, PLATFORM_MACOS, VersionTuple(10, 14)),
- Target(AK_arm64, PLATFORM_MACOS, VersionTuple(10, 14)),
- Target(AK_arm64, PLATFORM_MACCATALYST, VersionTuple(12, 1)),
+ Target(AK_arm64, PLATFORM_MACOS, VersionTuple(11, 0, 0)),
+ Target(AK_arm64, PLATFORM_MACCATALYST, VersionTuple(14, 0)),
};
EXPECT_EQ(mapToPlatformSet(AllTargets), File->getPlatforms());
EXPECT_EQ(mapToArchitectureSet(AllTargets), File->getArchitectures());
EXPECT_EQ(FileType::TBD_V5, File->getFileType());
TargetList ExpectedTargets = {
Target(AK_x86_64, PLATFORM_IOSSIMULATOR, VersionTuple(11, 3)),
- Target(AK_arm64, PLATFORM_IOSSIMULATOR, VersionTuple(11, 0)),
+ Target(AK_arm64, PLATFORM_IOSSIMULATOR, VersionTuple(14, 0)),
};
TargetList Targets{File->targets().begin(), File->targets().end()};
llvm::sort(Targets);