1 import("//llvm/utils/unittest/unittest.gni")
3 # Keyed off LLVM_ENABLE_PLUGINS in the CMake build, which is usually false
4 # on Windows and true elsewhere.
5 if (host_os != "win") {
6 loadable_module("TestPlugin") {
7 # Put plugin next to the unit test executable.
8 output_dir = target_out_dir
15 # TestPlugin doesn't want to link in any LLVM code, it just needs its
17 "//llvm/include/llvm/IR:public_tablegen",
20 if (host_os != "mac" && host_os != "win") {
21 # The GN build currently doesn't globally pass -fPIC, but that's
22 # needed for building .so files on ELF. Just pass it manually
23 # for loadable_modules for now.
29 unittest("PluginsTests") {
31 "//llvm/include/llvm/Config:config",
35 "//llvm/lib/Testing/Support",
41 # If plugins are disabled, this test will disable itself at runtime.
42 # Otherwise, reconfiguring with plugins disabled will leave behind a stale
44 if (host_os != "win") {
45 deps += [ ":TestPlugin" ]
46 defines = [ "LLVM_ENABLE_PLUGINS" ]
49 if (host_os != "mac" && host_os != "win") {
50 # Corresponds to export_executable_symbols() in cmake.
51 ldflags = [ "-rdynamic" ]