CMakePresets.json: Don't use architecture and toolset if empty

Fixes: #24864
This commit is contained in:
Kyle Edwards
2023-12-19 10:19:03 -05:00
parent bee73bce08
commit 0654051dde

View File

@@ -1576,14 +1576,15 @@ void cmake::SetArgs(const std::vector<std::string>& args)
if (!expandedPreset->ArchitectureStrategy ||
expandedPreset->ArchitectureStrategy ==
cmCMakePresetsGraph::ArchToolsetStrategy::Set) {
if (!this->GeneratorPlatformSet) {
if (!this->GeneratorPlatformSet &&
!expandedPreset->Architecture.empty()) {
this->SetGeneratorPlatform(expandedPreset->Architecture);
}
}
if (!expandedPreset->ToolsetStrategy ||
expandedPreset->ToolsetStrategy ==
cmCMakePresetsGraph::ArchToolsetStrategy::Set) {
if (!this->GeneratorToolsetSet) {
if (!this->GeneratorToolsetSet && !expandedPreset->Toolset.empty()) {
this->SetGeneratorToolset(expandedPreset->Toolset);
}
}