summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePresetsFileReadJSON.cxx
diff options
context:
space:
mode:
authorSam Freed <safreed@microsoft.com>2021-06-03 22:33:58 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-07 17:56:44 (GMT)
commitefe7ac9022b18132d33c68919c81422d738cd672 (patch)
tree8318f2e00483eef44567c66b79413f493434062a /Source/cmCMakePresetsFileReadJSON.cxx
parent9c33ff4dda643f8a93d55f9895e31dce9056134f (diff)
downloadCMake-efe7ac9022b18132d33c68919c81422d738cd672.zip
CMake-efe7ac9022b18132d33c68919c81422d738cd672.tar.gz
CMake-efe7ac9022b18132d33c68919c81422d738cd672.tar.bz2
presets: Fix buildPreset "targets" not allowing a single string
Fixes: #22272
Diffstat (limited to 'Source/cmCMakePresetsFileReadJSON.cxx')
-rw-r--r--Source/cmCMakePresetsFileReadJSON.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/cmCMakePresetsFileReadJSON.cxx b/Source/cmCMakePresetsFileReadJSON.cxx
index 909a78b..489551d 100644
--- a/Source/cmCMakePresetsFileReadJSON.cxx
+++ b/Source/cmCMakePresetsFileReadJSON.cxx
@@ -350,8 +350,8 @@ auto const PresetVectorStringHelper =
ReadFileResult::READ_OK, ReadFileResult::INVALID_PRESET,
PresetStringHelper);
-ReadFileResult PresetInheritsHelper(std::vector<std::string>& out,
- const Json::Value* value)
+ReadFileResult PresetVectorOneOrMoreStringHelper(std::vector<std::string>& out,
+ const Json::Value* value)
{
out.clear();
if (!value) {
@@ -478,8 +478,8 @@ auto const ConfigurePresetHelper =
cmJSONObjectHelper<ConfigurePreset, ReadFileResult>(
ReadFileResult::READ_OK, ReadFileResult::INVALID_PRESET, false)
.Bind("name"_s, &ConfigurePreset::Name, PresetStringHelper)
- .Bind("inherits"_s, &ConfigurePreset::Inherits, PresetInheritsHelper,
- false)
+ .Bind("inherits"_s, &ConfigurePreset::Inherits,
+ PresetVectorOneOrMoreStringHelper, false)
.Bind("hidden"_s, &ConfigurePreset::Hidden, PresetBoolHelper, false)
.Bind<std::nullptr_t>("vendor"_s, nullptr,
VendorHelper(ReadFileResult::INVALID_PRESET), false)
@@ -512,7 +512,8 @@ auto const BuildPresetHelper =
cmJSONObjectHelper<BuildPreset, ReadFileResult>(
ReadFileResult::READ_OK, ReadFileResult::INVALID_PRESET, false)
.Bind("name"_s, &BuildPreset::Name, PresetStringHelper)
- .Bind("inherits"_s, &BuildPreset::Inherits, PresetInheritsHelper, false)
+ .Bind("inherits"_s, &BuildPreset::Inherits,
+ PresetVectorOneOrMoreStringHelper, false)
.Bind("hidden"_s, &BuildPreset::Hidden, PresetBoolHelper, false)
.Bind<std::nullptr_t>("vendor"_s, nullptr,
VendorHelper(ReadFileResult::INVALID_PRESET), false)
@@ -528,7 +529,8 @@ auto const BuildPresetHelper =
&BuildPreset::InheritConfigureEnvironment, PresetOptionalBoolHelper,
false)
.Bind("jobs"_s, &BuildPreset::Jobs, PresetOptionalIntHelper, false)
- .Bind("targets"_s, &BuildPreset::Targets, PresetVectorStringHelper, false)
+ .Bind("targets"_s, &BuildPreset::Targets,
+ PresetVectorOneOrMoreStringHelper, false)
.Bind("configuration"_s, &BuildPreset::Configuration, PresetStringHelper,
false)
.Bind("cleanFirst"_s, &BuildPreset::CleanFirst, PresetOptionalBoolHelper,
@@ -831,7 +833,8 @@ auto const TestPresetHelper =
cmJSONObjectHelper<TestPreset, ReadFileResult>(
ReadFileResult::READ_OK, ReadFileResult::INVALID_PRESET, false)
.Bind("name"_s, &TestPreset::Name, PresetStringHelper)
- .Bind("inherits"_s, &TestPreset::Inherits, PresetInheritsHelper, false)
+ .Bind("inherits"_s, &TestPreset::Inherits,
+ PresetVectorOneOrMoreStringHelper, false)
.Bind("hidden"_s, &TestPreset::Hidden, PresetBoolHelper, false)
.Bind<std::nullptr_t>("vendor"_s, nullptr,
VendorHelper(ReadFileResult::INVALID_PRESET), false)