[lit] Improve lit.Run class
[llvm-complete.git] / utils / gn / secondary / llvm / tools / lto / BUILD.gn
blob135b952c1535298e5bdd01264017c0ac87e39b5d
1 import("//llvm/version.gni")
3 lto_target_type = "shared_library"
4 if (host_os != "mac" && host_os != "win") {
5   # ELF targets need -fPIC to build shared libs but they aren't on by default.
6   # For now, make libclang a static lib there.
7   lto_target_type = "static_library"
10 target(lto_target_type, "lto") {
11   output_name = "LTO"
12   deps = [
13     "//llvm/lib/Bitcode/Reader",
14     "//llvm/lib/IR",
15     "//llvm/lib/LTO",
16     "//llvm/lib/MC",
17     "//llvm/lib/MC/MCDisassembler",
18     "//llvm/lib/Support",
19     "//llvm/lib/Target",
20     "//llvm/lib/Target:TargetsToBuild",
21   ]
22   sources = [
23     "LTODisassembler.cpp",
24     "lto.cpp",
25   ]
27   if (host_os == "mac") {
28     ldflags = [
29       "-Wl,-compatibility_version,1",
30       "-Wl,-current_version,$llvm_version",
32       # See llvm_setup_rpath() in CMake.
33       "-Wl,-install_name,@rpath/libLTO.dylib",
34       "-Wl,-rpath,@loader_path/../lib",
35     ]
36   }
38   # FIXME: Use lto.exports