• Home
  • Raw
  • Download

Lines Matching +full:shared +full:- +full:llvm

1 // SPDX-License-Identifier: Apache-2.0
32 /// Gets the name of an LLVM or Clang static library from a path.
33 fn get_library_name(path: &Path) -> Option<String> { in get_library_name()
44 /// Gets the LLVM static libraries required to link to `libclang`.
45 fn get_llvm_libraries() -> Vec<String> { in get_llvm_libraries()
46 common::run_llvm_config(&["--libs"]) in get_llvm_libraries()
50 // Depending on the version of `llvm-config` in use, listed in get_llvm_libraries()
52 // or simply prefixed with `-l`. in get_llvm_libraries()
53 if let Some(path) = p.strip_prefix("-l") { in get_llvm_libraries()
63 fn get_clang_libraries<P: AsRef<Path>>(directory: P) -> Vec<String> { in get_clang_libraries()
79 /// Finds a directory containing LLVM and Clang static libraries and returns the
81 fn find() -> PathBuf { in find()
107 println!("cargo:rustc-link-search=native={}", directory.display()); in link()
109 println!("cargo:rustc-link-lib=static={}", library); in link()
112 // Determine the shared mode used by LLVM. in link()
113 let mode = common::run_llvm_config(&["--shared-mode"]).map(|m| m.trim().to_owned()); in link()
120 // Specify required LLVM static libraries. in link()
122 "cargo:rustc-link-search=native={}", in link()
123 common::run_llvm_config(&["--libdir"]).unwrap().trim_end() in link()
126 println!("cargo:rustc-link-lib={}{}", prefix, library); in link()
132 println!("cargo:rustc-flags=-l ffi -l ncursesw -l c++ -l z"); in link()
134 println!("cargo:rustc-flags=-l ffi -l ncursesw -l stdc++ -l z"); in link()
136 println!("cargo:rustc-flags=-l ffi -l ncurses -l c++ -l z"); in link()