summaryrefslogtreecommitdiff
path: root/Source/cmCMakePresetsGraph.cxx
diff options
context:
space:
mode:
authorSankhesh Jhaveri <sankhesh.jhaveri@kitware.com>2022-07-21 09:50:25 -0400
committerBrad King <brad.king@kitware.com>2022-08-03 10:20:04 -0400
commit47929ee98c44d84d9e86e23cc93093f857e11780 (patch)
treead5d32a956df67ba902d18220663e7ddecd2df48 /Source/cmCMakePresetsGraph.cxx
parent2be09731e0a441b5303344a91c2ba162e9fdf031 (diff)
downloadcmake-47929ee98c44d84d9e86e23cc93093f857e11780.tar.gz
presets: Add basic error forwarding from cmake preset json parser
Print errors only if there are errors. Add filename for better introspection, particularly for FileNotFound errors with presets.
Diffstat (limited to 'Source/cmCMakePresetsGraph.cxx')
-rw-r--r--Source/cmCMakePresetsGraph.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx
index b737c1f29e..dba79d58ad 100644
--- a/Source/cmCMakePresetsGraph.cxx
+++ b/Source/cmCMakePresetsGraph.cxx
@@ -901,8 +901,9 @@ cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles)
std::string filename = GetUserFilename(this->SourceDir);
std::vector<File*> inProgressFiles;
if (cmSystemTools::FileExists(filename)) {
- auto result = this->ReadJSONFile(filename, RootType::User,
- ReadReason::Root, inProgressFiles, file);
+ auto result =
+ this->ReadJSONFile(filename, RootType::User, ReadReason::Root,
+ inProgressFiles, file, this->errors);
if (result != ReadFileResult::READ_OK) {
return result;
}
@@ -910,8 +911,9 @@ cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles)
} else {
filename = GetFilename(this->SourceDir);
if (cmSystemTools::FileExists(filename)) {
- auto result = this->ReadJSONFile(
- filename, RootType::Project, ReadReason::Root, inProgressFiles, file);
+ auto result =
+ this->ReadJSONFile(filename, RootType::Project, ReadReason::Root,
+ inProgressFiles, file, this->errors);
if (result != ReadFileResult::READ_OK) {
return result;
}