Skip to content

presets: Improve JSON parser and error messages

Martin Duffy requested to merge martin.duffy/cmake:json-error-preset-2 into master

This aims to improve the quality of error messages displayed when parsing JSON input. Follow-up to !7231 (merged)

Before these changes:

CMake Error: Could not read presets from [FILE]: Invalid preset

After these changes:

CMake Error: Could not read presets from [FILE]:
Error: @10,15: Invalid Preset Name: 1
      "name": 1,
              ^
Error: @18,24: Invalid extra field "extra_arg" in variable "EX_CACHE" for preset "1"
          "extra_arg": "extra"
                       ^
Error: @28,19: "type" expected a string, got: 1
          "type": 1,
                  ^

Topic-rename: presets-json-errors

Edited by Brad King

Merge request reports