mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-07 04:02:23 +03:00
cmDyndepCollation: Don't serialize local arguments
LocalArguments as implemented in commit ce309f8885 (cmDyndepCollation:
Cxx module manifest format, 2026-01-22) carries dependency assumptions
which break when the resulting install tree is relocated or reused in an
different build environment. Module manifests are ill-equipped to solve
this problem. For now, forego local arguments entirely rather than
encode potentially bogus information.
Issue: #27565
This commit is contained in:
1 parent
1565dfea99
commit
ec3f41ab7b
1 file changed
+5
-26
@@ -370,27 +370,6 @@ Json::Value CollationInformationExports(cmGeneratorTarget const* gt)
|
||||
return tdi_exports;
|
||||
}
|
||||
|
||||
std::vector<cmCxxModuleMetadata::PreprocessorDefineData>
|
||||
MakePreprocessorDefines(std::vector<std::string> const& defines)
|
||||
{
|
||||
std::vector<cmCxxModuleMetadata::PreprocessorDefineData> result;
|
||||
result.reserve(defines.size());
|
||||
|
||||
for (auto const& def : defines) {
|
||||
cmCxxModuleMetadata::PreprocessorDefineData data;
|
||||
auto offset = def.find('=');
|
||||
if (offset == def.npos) {
|
||||
data.Name = def;
|
||||
} else {
|
||||
data.Name = def.substr(0, offset);
|
||||
data.Value = def.substr(offset);
|
||||
}
|
||||
result.emplace_back(std::move(data));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void cmDyndepCollation::AddCollationInformation(
|
||||
@@ -826,11 +805,11 @@ bool cmDyndepCollation::WriteDyndepMetadata(
|
||||
mod.LogicalName = p.LogicalName;
|
||||
mod.IsInterface = p.IsInterface;
|
||||
|
||||
auto& local_args = mod.LocalArguments.emplace();
|
||||
local_args.Definitions = MakePreprocessorDefines(file_set.Definitions);
|
||||
local_args.IncludeDirectories = file_set.IncludeDirectories;
|
||||
local_args.CompileOptions = file_set.CompileOptions;
|
||||
local_args.CompileFeatures = file_set.CompileFeatures;
|
||||
// FIXME(#27565): Local arguments may refer to include directories or
|
||||
// other resources which live in unknown locations on the consuming
|
||||
// machine. There's no general-purpose way to solve this with module
|
||||
// manifests as currently specified. For now, forego serializing them
|
||||
// and rely on CPS to fill in the blanks.
|
||||
|
||||
exp.Manifest.Modules.emplace_back(std::move(mod));
|
||||
|
||||
|
||||
Reference in new issue
Block a user