summaryrefslogtreecommitdiffstats
path: root/Source/cmDyndepCollation.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-05-14 21:23:19 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-05-16 02:26:36 (GMT)
commit8207a3a266d85e64532a2a69ccea344fd645fe53 (patch)
treed4901ad23963c7f2509793c82062a190ce2f731b /Source/cmDyndepCollation.cxx
parente8efcbec8c7e66e6e7ab45354189b9fc4166938e (diff)
downloadCMake-8207a3a266d85e64532a2a69ccea344fd645fe53.zip
CMake-8207a3a266d85e64532a2a69ccea344fd645fe53.tar.gz
CMake-8207a3a266d85e64532a2a69ccea344fd645fe53.tar.bz2
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.
Diffstat (limited to 'Source/cmDyndepCollation.cxx')
-rw-r--r--Source/cmDyndepCollation.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx
index 53a262b..f45d81b 100644
--- a/Source/cmDyndepCollation.cxx
+++ b/Source/cmDyndepCollation.cxx
@@ -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);
+}