MCPcopy Index your code
hub / github.com/Kitware/CMake / CheckPropertyCompatibility

Method CheckPropertyCompatibility

Source/cmGeneratorTarget_CompatibleInterface.cxx:246–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246void 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 }

Callers 1

GetLinkInformationMethod · 0.95

Calls 15

intersectFunction · 0.85
cmMakeRangeFunction · 0.85
GetItemsMethod · 0.80
push_backMethod · 0.80
retreatMethod · 0.80
strMethod · 0.80
cmStrCatFunction · 0.70
cmJoinFunction · 0.70
GetTypeMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected