Embedded Python executable (base interpreter for uv sync/venv and plugin isolation)
| 322 | |
| 323 | // Embedded Python executable (base interpreter for uv sync/venv and plugin isolation) |
| 324 | inline std::filesystem::path getEmbeddedPython() { |
| 325 | const auto exe_dir = getExecutableDir(); |
| 326 | |
| 327 | #ifdef _WIN32 |
| 328 | if (const auto p = exe_dir / "python.exe"; std::filesystem::exists(p)) |
| 329 | return p; |
| 330 | |
| 331 | if (const auto prefix = findVcpkgPrefix(exe_dir); !prefix.empty()) { |
| 332 | if (const auto p = prefix / "tools" / "python3" / "python.exe"; std::filesystem::exists(p)) |
| 333 | return p; |
| 334 | } |
| 335 | #else |
| 336 | if (const auto p = exe_dir / "python3"; std::filesystem::exists(p)) |
| 337 | return p; |
| 338 | |
| 339 | if (const auto prefix = findVcpkgPrefix(exe_dir); !prefix.empty()) { |
| 340 | if (const auto p = prefix / "tools" / "python3" / "python3.12"; std::filesystem::exists(p)) |
| 341 | return p; |
| 342 | } |
| 343 | #endif |
| 344 | |
| 345 | #ifdef LFS_PYTHON_EXECUTABLE |
| 346 | if (const auto p = std::filesystem::path(LFS_PYTHON_EXECUTABLE); std::filesystem::exists(p)) |
| 347 | return p; |
| 348 | #endif |
| 349 | |
| 350 | return {}; |
| 351 | } |
| 352 | |
| 353 | // nvImageCodec extensions directory |
| 354 | inline std::filesystem::path getExtensionsDir() { |
no test coverage detected