| 109 | } |
| 110 | |
| 111 | bool ParseLocalArguments(Json::Value& lav, |
| 112 | cmCxxModuleMetadata::LocalArgumentsData& out, |
| 113 | cmJSONState* state) |
| 114 | { |
| 115 | if (!lav.isObject()) { |
| 116 | state->AddErrorAtValue("'local-arguments' must be an object", &lav); |
| 117 | return false; |
| 118 | } |
| 119 | |
| 120 | if (lav.isMember("include-directories")) { |
| 121 | if (!JsonIsStringArray(lav["include-directories"])) { |
| 122 | state->AddErrorAtValue( |
| 123 | "'include-directories' must be an array of strings", |
| 124 | &lav["include-directories"]); |
| 125 | return false; |
| 126 | } |
| 127 | for (auto const& s : lav["include-directories"]) { |
| 128 | out.IncludeDirectories.push_back(s.asString()); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | if (lav.isMember("system-include-directories")) { |
| 133 | if (!JsonIsStringArray(lav["system-include-directories"])) { |
| 134 | state->AddErrorAtValue( |
| 135 | "'system-include-directories' must be an array of strings", |
| 136 | &lav["system-include-directories"]); |
| 137 | return false; |
| 138 | } |
| 139 | for (auto const& s : lav["system-include-directories"]) { |
| 140 | out.SystemIncludeDirectories.push_back(s.asString()); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | if (lav.isMember("definitions")) { |
| 145 | if (!lav["definitions"].isArray()) { |
| 146 | state->AddErrorAtValue("'definitions' must be an array", |
| 147 | &lav["definitions"]); |
| 148 | return false; |
| 149 | } |
| 150 | for (Json::Value& dval : lav["definitions"]) { |
| 151 | out.Definitions.emplace_back(); |
| 152 | if (!ParsePreprocessorDefine(dval, out.Definitions.back(), state)) { |
| 153 | return false; |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | if (lav.isMember("vendor")) { |
| 159 | if (!ParseCMakeLocalArgumentsVendor(lav["vendor"], out, state)) { |
| 160 | return false; |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | return true; |
| 165 | } |
| 166 | |
| 167 | bool ParseModule(Json::Value& mval, cmCxxModuleMetadata::ModuleData& mod, |
| 168 | cmJSONState* state) |
no test coverage detected
searching dependent graphs…