Detect if running from a build directory
(exe_dir: &Option<PathBuf>)
| 223 | |
| 224 | /// Detect if running from a build directory |
| 225 | fn detect_build_directory(exe_dir: &Option<PathBuf>) -> Option<PathBuf> { |
| 226 | let dir = exe_dir.as_ref()?; |
| 227 | |
| 228 | // Check for pybuilddir.txt (indicates build directory) |
| 229 | if dir.join(platform::BUILDDIR_TXT).exists() { |
| 230 | return Some(dir.clone()); |
| 231 | } |
| 232 | |
| 233 | // Check for Modules/Setup.local (build landmark) |
| 234 | if dir.join(platform::BUILD_LANDMARK).exists() { |
| 235 | return Some(dir.clone()); |
| 236 | } |
| 237 | |
| 238 | // Search up for Lib/os.py (build stdlib landmark) |
| 239 | search_up_file(dir, &[platform::BUILDSTDLIB_LANDMARK]) |
| 240 | } |
| 241 | |
| 242 | /// Calculate prefix by searching for landmarks |
| 243 | fn calculate_prefix(exe_dir: &Option<PathBuf>, build_prefix: &Option<PathBuf>) -> String { |
no test coverage detected