| 244 | } |
| 245 | |
| 246 | void cmGeneratorTarget::CheckPropertyCompatibility( |
| 247 | cmComputeLinkInformation& info, std::string const& config) const |
| 248 | { |
| 249 | cmComputeLinkInformation::ItemVector const& deps = info.GetItems(); |
| 250 | |
| 251 | std::set<std::string> emittedBools; |
| 252 | static std::string const strBool = "COMPATIBLE_INTERFACE_BOOL"; |
| 253 | std::set<std::string> emittedStrings; |
| 254 | static std::string const strString = "COMPATIBLE_INTERFACE_STRING"; |
| 255 | std::set<std::string> emittedMinNumbers; |
| 256 | static std::string const strNumMin = "COMPATIBLE_INTERFACE_NUMBER_MIN"; |
| 257 | std::set<std::string> emittedMaxNumbers; |
| 258 | static std::string const strNumMax = "COMPATIBLE_INTERFACE_NUMBER_MAX"; |
| 259 | |
| 260 | for (auto const& dep : deps) { |
| 261 | if (!dep.Target || dep.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) { |
| 262 | continue; |
| 263 | } |
| 264 | |
| 265 | checkPropertyConsistency<bool>(this, dep.Target, strBool, emittedBools, |
| 266 | config, BoolType, nullptr); |
| 267 | if (cmSystemTools::GetErrorOccurredFlag()) { |
| 268 | return; |
| 269 | } |
| 270 | checkPropertyConsistency<char const*>(this, dep.Target, strString, |
| 271 | emittedStrings, config, StringType, |
| 272 | nullptr); |
| 273 | if (cmSystemTools::GetErrorOccurredFlag()) { |
| 274 | return; |
| 275 | } |
| 276 | checkPropertyConsistency<char const*>(this, dep.Target, strNumMin, |
| 277 | emittedMinNumbers, config, |
| 278 | NumberMinType, nullptr); |
| 279 | if (cmSystemTools::GetErrorOccurredFlag()) { |
| 280 | return; |
| 281 | } |
| 282 | checkPropertyConsistency<char const*>(this, dep.Target, strNumMax, |
| 283 | emittedMaxNumbers, config, |
| 284 | NumberMaxType, nullptr); |
| 285 | if (cmSystemTools::GetErrorOccurredFlag()) { |
| 286 | return; |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | std::string prop = intersect(emittedBools, emittedStrings, emittedMinNumbers, |
| 291 | emittedMaxNumbers); |
| 292 | |
| 293 | if (!prop.empty()) { |
| 294 | // Use a sorted std::vector to keep the error message sorted. |
| 295 | std::vector<std::string> props; |
| 296 | auto i = emittedBools.find(prop); |
| 297 | if (i != emittedBools.end()) { |
| 298 | props.push_back(strBool); |
| 299 | } |
| 300 | i = emittedStrings.find(prop); |
| 301 | if (i != emittedStrings.end()) { |
| 302 | props.push_back(strString); |
| 303 | } |
no test coverage detected