Another fix for r329293: Unbreak the windows bots

Only build the unittest if plugins are enabled. Link components into the
TestPlugin on windows and cygwin.

llvm-svn: 329318
This commit is contained in:
Philip Pfaffe 2018-04-05 17:20:45 +00:00
parent 4e150c4c88
commit 802ee317e6
1 changed files with 20 additions and 13 deletions

View File

@ -1,5 +1,6 @@
set(LLVM_LINK_COMPONENTS Support Passes Core) set(LLVM_LINK_COMPONENTS Support Passes Core)
if (LLVM_ENABLE_PLUGINS)
add_llvm_unittest(PluginsTests PluginsTest.cpp) add_llvm_unittest(PluginsTests PluginsTest.cpp)
export_executable_symbols(PluginsTests) export_executable_symbols(PluginsTests)
@ -15,5 +16,11 @@ set_target_properties(TestPlugin
SUFFIX ".so" SUFFIX ".so"
) )
if (WIN32 OR CYGWIN)
llvm_map_components_to_libnames(LLVM_DEPS ${LLVM_LINK_COMPONENTS})
target_link_libraries(TestPlugin ${LLVM_DEPS})
endif()
add_dependencies(TestPlugin intrinsics_gen) add_dependencies(TestPlugin intrinsics_gen)
add_dependencies(PluginsTests TestPlugin) add_dependencies(PluginsTests TestPlugin)
endif()