From a53748e31906b5821f3aedeb848ac53dcdd6389d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 7 Feb 2023 17:57:16 -0500 Subject: [PATCH] cmDyndepCollation: add a query for whether an object is BMI-only The collator needs to know that the object *is* a BMI so that it can just use the location directly. --- Source/cmDyndepCollation.cxx | 13 +++++++++++++ Source/cmDyndepCollation.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx index bdf6b4472e..bd2f546309 100644 --- a/Source/cmDyndepCollation.cxx +++ b/Source/cmDyndepCollation.cxx @@ -666,3 +666,16 @@ bool cmDyndepCollation::IsObjectPrivate( auto const& file_set = fileset_info_itr->second; return !cmFileSetVisibilityIsForInterface(file_set.Visibility); } + +bool cmDyndepCollation::IsBmiOnly(cmCxxModuleExportInfo const& exportInfo, + std::string const& object) +{ +#ifdef _WIN32 + auto object_path = object; + cmSystemTools::ConvertToUnixSlashes(object_path); +#else + auto const& object_path = object; +#endif + auto fs = exportInfo.ObjectToFileSet.find(object_path); + return (fs != exportInfo.ObjectToFileSet.end()) && fs->second.BmiOnly; +} diff --git a/Source/cmDyndepCollation.h b/Source/cmDyndepCollation.h index 21f1fe90a3..b193467b65 100644 --- a/Source/cmDyndepCollation.h +++ b/Source/cmDyndepCollation.h @@ -53,4 +53,7 @@ struct cmDyndepCollation cmDyndepMetadataCallbacks const& cb); static bool IsObjectPrivate(std::string const& object, cmCxxModuleExportInfo const& export_info); + + static bool IsBmiOnly(cmCxxModuleExportInfo const& exportInfo, + std::string const& object); };