| 3339 | } |
| 3340 | |
| 3341 | static 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 | |
| 3373 | namespace { |
| 3374 | struct cmSystemToolsRPathInfo |
no test coverage detected
searching dependent graphs…