| 1317 | } |
| 1318 | |
| 1319 | std::string cmSystemTools::GetRealPathResolvingWindowsSubst( |
| 1320 | std::string const& path, std::string* errorMessage) |
| 1321 | { |
| 1322 | #ifdef _WIN32 |
| 1323 | // uv_fs_realpath uses Windows Vista API so fallback to kwsys if not found |
| 1324 | std::string resolved_path; |
| 1325 | uv_fs_t req; |
| 1326 | int err = uv_fs_realpath(nullptr, &req, path.c_str(), nullptr); |
| 1327 | if (!err) { |
| 1328 | resolved_path = std::string((char*)req.ptr); |
| 1329 | cmSystemTools::ConvertToUnixSlashes(resolved_path); |
| 1330 | } else if (err == UV_ENOSYS) { |
| 1331 | resolved_path = cmsys::SystemTools::GetRealPath(path, errorMessage); |
| 1332 | } else if (errorMessage) { |
| 1333 | cmsys::Status status = |
| 1334 | cmsys::Status::Windows(uv_fs_get_system_error(&req)); |
| 1335 | *errorMessage = status.GetString(); |
| 1336 | resolved_path.clear(); |
| 1337 | } else { |
| 1338 | resolved_path = path; |
| 1339 | } |
| 1340 | // Normalize to upper-case drive letter as cm::PathResolver does. |
| 1341 | if (resolved_path.size() > 1 && resolved_path[1] == ':') { |
| 1342 | resolved_path[0] = cmsysString_toupper(resolved_path[0]); |
| 1343 | } |
| 1344 | return resolved_path; |
| 1345 | #else |
| 1346 | return cmsys::SystemTools::GetRealPath(path, errorMessage); |
| 1347 | #endif |
| 1348 | } |
| 1349 | |
| 1350 | std::string cmSystemTools::GetRealPath(std::string const& path, |
| 1351 | std::string* errorMessage) |
nothing calls this directly
no test coverage detected