mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Merge topic 'misc-cxx-modules-fixes'
28ece63feecxxmodules: Fix exported path to installed module sources in subdirsf2a699261bcxxmodules: Do not expect collator install scripts with no CXX_MODULESf9677cc122Tests: Improve RunCMake.CXXModules expectation matching and error reporting Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !8474
This commit is contained in:
@@ -358,6 +358,10 @@ cmDyndepCollation::ParseExportInfo(Json::Value const& tdi)
|
||||
fsi.Name = tdi_cxx_module_info["name"].asString();
|
||||
fsi.RelativeDirectory =
|
||||
tdi_cxx_module_info["relative-directory"].asString();
|
||||
if (!fsi.RelativeDirectory.empty() &&
|
||||
fsi.RelativeDirectory.back() != '/') {
|
||||
fsi.RelativeDirectory = cmStrCat(fsi.RelativeDirectory, '/');
|
||||
}
|
||||
fsi.SourcePath = tdi_cxx_module_info["source"].asString();
|
||||
fsi.Type = tdi_cxx_module_info["type"].asString();
|
||||
fsi.Visibility = cmFileSetVisibilityFromName(
|
||||
|
||||
@@ -542,6 +542,12 @@ bool cmExportBuildFileGenerator::GenerateImportCxxModuleConfigTargetInclusion(
|
||||
os.SetCopyIfDifferent(true);
|
||||
|
||||
for (auto const* tgt : this->ExportedTargets) {
|
||||
// Only targets with C++ module sources will have a
|
||||
// collator-generated install script.
|
||||
if (!tgt->HaveCxx20ModuleSources()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
os << "include(\"${CMAKE_CURRENT_LIST_DIR}/target-" << tgt->GetExportName()
|
||||
<< '-' << config << ".cmake\")\n";
|
||||
}
|
||||
|
||||
@@ -752,6 +752,12 @@ bool cmExportInstallFileGenerator::
|
||||
|
||||
auto& prop_files = this->ConfigCxxModuleTargetFiles[config];
|
||||
for (auto const* tgt : this->ExportedTargets) {
|
||||
// Only targets with C++ module sources will have a
|
||||
// collator-generated install script.
|
||||
if (!tgt->HaveCxx20ModuleSources()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto prop_filename = cmStrCat("target-", tgt->GetExportName(), '-',
|
||||
filename_config, ".cmake");
|
||||
prop_files.emplace_back(cmStrCat(dest, prop_filename));
|
||||
|
||||
Reference in New Issue
Block a user