diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-16 20:19:11 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-22 15:24:39 (GMT) |
commit | 64afabdbcb265acb53a9b8f8cb86465d31f2ca61 (patch) | |
tree | ca2616a38a2bf7c80d8635d7fd0f2957645a0a45 /Source/QtDialog | |
parent | 609122007dc074739b394d2f70f674bbccca6073 (diff) | |
download | CMake-64afabdbcb265acb53a9b8f8cb86465d31f2ca61.zip CMake-64afabdbcb265acb53a9b8f8cb86465d31f2ca61.tar.gz CMake-64afabdbcb265acb53a9b8f8cb86465d31f2ca61.tar.bz2 |
CMakePresets.json: Split cmakeGeneratorConfig field
Make this field separate for both architecture and toolset. Allow
architecture and toolset to be either strings or objects with value
and strategy fields.
Fixes: #21317
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 4 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 6 | ||||
-rw-r--r-- | Source/QtDialog/QCMakePreset.cxx | 17 | ||||
-rw-r--r-- | Source/QtDialog/QCMakePreset.h | 3 |
4 files changed, 19 insertions, 11 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 7a04daa..a15614d 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -859,8 +859,10 @@ bool CMakeSetupDialog::setupFirstConfigure() if (presetData.isValid()) { auto preset = presetData.value<QCMakePreset>(); dialog.setCurrentGenerator(preset.generator); - if (preset.setGenConfig) { + if (preset.setArchitecture) { dialog.setPlatform(preset.architecture); + } + if (preset.setToolset) { dialog.setToolset(preset.toolset); } dialog.setCompilerOption(CompilerOption::DefaultNative); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 3789e93..2f41f70 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -551,9 +551,11 @@ void QCMake::loadPresets() preset.generator = std::move(QString::fromLocal8Bit(p.Generator.data())); preset.architecture = std::move(QString::fromLocal8Bit(p.Architecture.data())); + preset.setArchitecture = !p.ArchitectureStrategy || + p.ArchitectureStrategy == cmCMakePresetsFile::ArchToolsetStrategy::Set; preset.toolset = std::move(QString::fromLocal8Bit(p.Toolset.data())); - preset.setGenConfig = !p.GeneratorConfig || - p.GeneratorConfig == cmCMakePresetsFile::CMakeGeneratorConfig::Default; + preset.setToolset = !p.ToolsetStrategy || + p.ToolsetStrategy == cmCMakePresetsFile::ArchToolsetStrategy::Set; preset.enabled = it.Expanded && std::find_if(this->AvailableGenerators.begin(), this->AvailableGenerators.end(), diff --git a/Source/QtDialog/QCMakePreset.cxx b/Source/QtDialog/QCMakePreset.cxx index b10cf07..176f532 100644 --- a/Source/QtDialog/QCMakePreset.cxx +++ b/Source/QtDialog/QCMakePreset.cxx @@ -6,8 +6,9 @@ bool operator==(const QCMakePreset& lhs, const QCMakePreset& rhs) { return lhs.name == rhs.name && lhs.displayName == rhs.displayName && lhs.description == rhs.description && lhs.generator == rhs.generator && - lhs.architecture == rhs.architecture && lhs.toolset == rhs.toolset && - lhs.setGenConfig == rhs.setGenConfig && lhs.enabled == rhs.enabled; + lhs.architecture == rhs.architecture && + lhs.setArchitecture == rhs.setArchitecture && lhs.toolset == rhs.toolset && + lhs.setToolset == rhs.setToolset && lhs.enabled == rhs.enabled; } bool operator!=(const QCMakePreset& lhs, const QCMakePreset& rhs) @@ -27,11 +28,13 @@ bool operator<(const QCMakePreset& lhs, const QCMakePreset& rhs) (lhs.generator == rhs.generator && (lhs.architecture < rhs.architecture || (lhs.architecture == rhs.architecture && - (lhs.toolset < rhs.toolset || - (lhs.toolset == rhs.toolset && - (lhs.setGenConfig < rhs.setGenConfig || - (lhs.setGenConfig == rhs.setGenConfig && - (lhs.enabled < rhs.enabled)))))))))))))); + (lhs.setArchitecture < rhs.setArchitecture || + (lhs.setArchitecture == rhs.setArchitecture && + (lhs.toolset < rhs.toolset || + (lhs.toolset == rhs.toolset && + (lhs.setToolset < rhs.setToolset || + (lhs.setToolset == rhs.setToolset && + (lhs.enabled < rhs.enabled)))))))))))))))); } bool operator<=(const QCMakePreset& lhs, const QCMakePreset& rhs) diff --git a/Source/QtDialog/QCMakePreset.h b/Source/QtDialog/QCMakePreset.h index 93d70d8..1609fcb 100644 --- a/Source/QtDialog/QCMakePreset.h +++ b/Source/QtDialog/QCMakePreset.h @@ -15,8 +15,9 @@ public: QString description; QString generator; QString architecture; + bool setArchitecture; QString toolset; - bool setGenConfig; + bool setToolset; bool enabled; }; |