Lines Matching refs:directory

132 /// `libclang` directory patterns for Haiku.
142 /// `libclang` directory patterns for Linux (and FreeBSD).
153 /// `libclang` directory patterns for macOS.
161 /// `libclang` directory patterns for Windows.
175 /// `libclang` directory patterns for illumos
185 /// Finds the files in a directory that match one or more filename glob patterns
187 fn search_directory(directory: &Path, filenames: &[String]) -> Vec<(PathBuf, String)> {
188 // Escape the specified directory in case it contains characters that have
190 let directory = Pattern::escape(directory.to_str().unwrap());
191 let directory = Path::new(&directory);
193 // Join the escaped directory to the filename glob patterns to obtain
197 .map(|f| directory.join(f).to_str().unwrap().to_owned());
200 // is limited to the specified directory.
220 Some((directory.to_owned(), filename.into()))
225 /// Finds the files in a directory (and any relevant sibling directories) that
228 fn search_directories(directory: &Path, filenames: &[String]) -> Vec<(PathBuf, String)> {
229 let mut results = search_directory(directory, filenames);
231 // On Windows, `libclang.dll` is usually found in the LLVM `bin` directory
232 // while `libclang.lib` is usually found in the LLVM `lib` directory. To
234 // are included in the backup search directory globs so we need to search
235 // the LLVM `bin` directory here.
236 if cfg!(target_os = "windows") && directory.ends_with("lib") {
237 let sibling = directory.parent().unwrap().join("bin");
259 // Check if the path is directory containing a matching file.
265 // Search the `bin` and `lib` directories in the directory returned by
268 let directory = Path::new(output.lines().next().unwrap()).to_path_buf();
269 found.extend(search_directories(&directory.join("bin"), filenames));
270 found.extend(search_directories(&directory.join("lib"), filenames));
271 found.extend(search_directories(&directory.join("lib64"), filenames));
274 // Search the toolchain directory in the directory returned by
278 let directory = Path::new(output.lines().next().unwrap()).to_path_buf();
279 let directory = directory.join("Toolchains/XcodeDefault.xctoolchain/usr/lib");
280 found.extend(search_directories(&directory, filenames));
286 for directory in env::split_paths(&path) {
287 found.extend(search_directories(&directory, filenames));
291 // Determine the `libclang` directory patterns.
306 // Search the directories provided by the `libclang` directory patterns.
310 for directory in directories.iter().rev() {
311 if let Ok(directories) = glob::glob_with(directory, options) {
312 for directory in directories.filter_map(Result::ok).filter(|p| p.is_dir()) {
313 found.extend(search_directories(&directory, filenames));