# - linking in clangTidyPlugin and clangIncludeFixerPlugin from
# clang-tools-extra (which doesn't have any GN build files yet)
# - using libclang.exports
-# - an build target copying the Python bindings
+# - a build target copying the Python bindings
# - the GN linux build always builds without -fPIC (as if LLVM_ENABLE_PIC=OFF
# in the CMake build), so libclang is always a static library on linux
# - the GN build doesn't have LIBCLANG_BUILD_STATIC
ldflags = [
"-Wl,-compatibility_version,1",
"-Wl,-current_version,$llvm_version",
+
+ # See llvm_setup_rpath() in CMake.
"-Wl,-install_name,@rpath/libclang.dylib",
+ "-Wl,-rpath,@loader_path/../lib",
]
}
+
+ # FIXME: Use libclang.exports
}
--- /dev/null
+import("//llvm/version.gni")
+
+lto_target_type = "loadable_module"
+if (host_os == "linux") {
+ # Linux needs -fPIC to build shared libs but they aren't on by default.
+ # For now, make libclang a static lib there.
+ lto_target_type = "static_library"
+}
+
+target(lto_target_type, "lto") {
+ output_name = "libLTO"
+ deps = [
+ "//llvm/lib/Bitcode/Reader",
+ "//llvm/lib/IR",
+ "//llvm/lib/LTO",
+ "//llvm/lib/MC",
+ "//llvm/lib/MC/MCDisassembler",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target",
+ "//llvm/lib/Target:TargetsToBuild",
+ ]
+ sources = [
+ "LTODisassembler.cpp",
+ "lto.cpp",
+ ]
+
+ if (host_os == "mac") {
+ ldflags = [
+ "-Wl,-compatibility_version,1",
+ "-Wl,-current_version,$llvm_version",
+
+ # See llvm_setup_rpath() in CMake.
+ "-Wl,-install_name,@rpath/libLTO.dylib",
+ "-Wl,-rpath,@loader_path/../lib",
+ ]
+ }
+
+ # FIXME: Use lto.exports
+}