1 # Needed by LLVM's CMake checks because this file defines multiple targets.
2 set(LLVM_OPTIONAL_SOURCES PluginsTest.cpp TestPlugin.cpp)
4 # If plugins are disabled, this test will disable itself at runtime. Otherwise,
5 # reconfiguring with plugins disabled will leave behind a stale executable.
6 if (LLVM_ENABLE_PLUGINS)
7 add_definitions(-DLLVM_ENABLE_PLUGINS)
10 set(LLVM_LINK_COMPONENTS Support Passes Core)
11 add_llvm_unittest(PluginsTests
14 export_executable_symbols(PluginsTests)
15 target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport)
17 set(LLVM_LINK_COMPONENTS)
18 add_llvm_library(TestPlugin MODULE BUILDTREE_ONLY
22 # Put plugin next to the unit test executable.
23 set_output_directory(TestPlugin
24 BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
25 LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
27 set_target_properties(TestPlugin PROPERTIES FOLDER "Tests")
29 add_dependencies(TestPlugin intrinsics_gen)
30 add_dependencies(PluginsTests TestPlugin)