mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-21 06:10:16 +08:00
cmScanDepFormat: P1689R4: Diagnose invalid provides/requires json type
This commit is contained in:
@@ -133,7 +133,13 @@ bool cmScanDepFormat_P1689_Parse(std::string const& arg_pp,
|
||||
|
||||
if (rule.isMember("provides")) {
|
||||
Json::Value const& provides = rule["provides"];
|
||||
if (provides.isArray()) {
|
||||
if (!provides.isArray()) {
|
||||
cmSystemTools::Error(
|
||||
cmStrCat("-E cmake_ninja_dyndep failed to parse ", arg_pp,
|
||||
": provides is not an array"));
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto const& provide : provides) {
|
||||
cmSourceReqInfo provide_info;
|
||||
|
||||
@@ -153,11 +159,16 @@ bool cmScanDepFormat_P1689_Parse(std::string const& arg_pp,
|
||||
info->Provides.push_back(provide_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rule.isMember("requires")) {
|
||||
Json::Value const& reqs = rule["requires"];
|
||||
if (reqs.isArray()) {
|
||||
if (!reqs.isArray()) {
|
||||
cmSystemTools::Error(
|
||||
cmStrCat("-E cmake_ninja_dyndep failed to parse ", arg_pp,
|
||||
": requires is not an array"));
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto const& require : reqs) {
|
||||
cmSourceReqInfo require_info;
|
||||
|
||||
@@ -176,7 +187,6 @@ bool cmScanDepFormat_P1689_Parse(std::string const& arg_pp,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user