MCPcopy Create free account
hub / github.com/Kitware/CMake / cmSystemToolsFindRPath

Function cmSystemToolsFindRPath

Source/cmSystemTools.cxx:3341–3371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3339}
3340
3341static std::string::size_type cmSystemToolsFindRPath(cm::string_view have,
3342 cm::string_view want)
3343{
3344 std::string::size_type pos = 0;
3345 while (pos < have.size()) {
3346 // Look for an occurrence of the string.
3347 std::string::size_type const beg = have.find(want, pos);
3348 if (beg == std::string::npos) {
3349 return std::string::npos;
3350 }
3351
3352 // Make sure it is separated from preceding entries.
3353 if (beg > 0 && have[beg - 1] != ':') {
3354 pos = beg + 1;
3355 continue;
3356 }
3357
3358 // Make sure it is separated from following entries.
3359 std::string::size_type const end = beg + want.size();
3360 if (end < have.size() && have[end] != ':') {
3361 pos = beg + 1;
3362 continue;
3363 }
3364
3365 // Return the position of the path portion.
3366 return beg;
3367 }
3368
3369 // The desired rpath was not found.
3370 return std::string::npos;
3371}
3372
3373namespace {
3374struct cmSystemToolsRPathInfo

Callers 3

ChangeRPathELFFunction · 0.85
ChangeRPathXCOFFFunction · 0.85
CheckRPathMethod · 0.85

Calls 2

sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…