1 # Needed by LLVM's CMake checks because this file defines multiple targets. 2 set(LLVM_OPTIONAL_SOURCES PluginsTest.cpp TestPlugin.cpp) 3 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) 8 endif() 9 10 set(LLVM_LINK_COMPONENTS Support Passes Core) 11 add_llvm_unittest(PluginsTests 12 PluginsTest.cpp 13 ) 14 export_executable_symbols(PluginsTests) 15 16 set(LLVM_LINK_COMPONENTS) 17 add_llvm_loadable_module(TestPlugin 18 TestPlugin.cpp 19 ) 20 21 # Put plugin next to the unit test executable. 22 set_output_directory(TestPlugin 23 BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} 24 LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} 25 ) 26 set_target_properties(TestPlugin PROPERTIES FOLDER "Tests") 27 28 add_dependencies(TestPlugin intrinsics_gen) 29 add_dependencies(PluginsTests TestPlugin) 30