summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-12-19 15:19:03 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-12-19 15:19:03 (GMT)
commit0654051dde88dfb8e374ac7e53bfc46c574b0169 (patch)
tree31a4ab9814dc7572688be6999319d8e5018baaee /Source/cmake.cxx
parentbee73bce083565369a22ac2558dbc7d68354e476 (diff)
downloadCMake-0654051dde88dfb8e374ac7e53bfc46c574b0169.zip
CMake-0654051dde88dfb8e374ac7e53bfc46c574b0169.tar.gz
CMake-0654051dde88dfb8e374ac7e53bfc46c574b0169.tar.bz2
CMakePresets.json: Don't use architecture and toolset if empty
Fixes: #24864
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index fd22957..32064b4 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -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);
}
}