mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 02:39:48 -06:00
cmDyndepCollation: add a query for visibility of an object's modules
This will be used to hide private modules from the view of consuming targets.
This commit is contained in:
@@ -623,3 +623,20 @@ bool cmDyndepCollation::WriteDyndepMetadata(
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool cmDyndepCollation::IsObjectPrivate(
|
||||
std::string const& object, cmCxxModuleExportInfo const& export_info)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
std::string output_path = object;
|
||||
cmSystemTools::ConvertToUnixSlashes(output_path);
|
||||
#else
|
||||
std::string const& output_path = object;
|
||||
#endif
|
||||
auto fileset_info_itr = export_info.ObjectToFileSet.find(output_path);
|
||||
if (fileset_info_itr == export_info.ObjectToFileSet.end()) {
|
||||
return false;
|
||||
}
|
||||
auto const& file_set = fileset_info_itr->second;
|
||||
return !cmFileSetVisibilityIsForInterface(file_set.Visibility);
|
||||
}
|
||||
|
||||
@@ -49,4 +49,6 @@ struct cmDyndepCollation
|
||||
std::vector<cmScanDepInfo> const& objects,
|
||||
cmCxxModuleExportInfo const& export_info,
|
||||
cmDyndepMetadataCallbacks const& cb);
|
||||
static bool IsObjectPrivate(std::string const& object,
|
||||
cmCxxModuleExportInfo const& export_info);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user