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,19 +1,26 @@
set(LLVM_LINK_COMPONENTS Support Passes Core)
add_llvm_unittest(PluginsTests PluginsTest.cpp)
export_executable_symbols(PluginsTests)
if (LLVM_ENABLE_PLUGINS)
add_llvm_unittest(PluginsTests PluginsTest.cpp)
export_executable_symbols(PluginsTests)
add_library(TestPlugin MODULE TestPlugin.cxx)
add_library(TestPlugin MODULE TestPlugin.cxx)
set_output_directory(TestPlugin
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
)
set_output_directory(TestPlugin
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
)
set_target_properties(TestPlugin
PROPERTIES PREFIX ""
SUFFIX ".so"
)
set_target_properties(TestPlugin
PROPERTIES PREFIX ""
SUFFIX ".so"
)
add_dependencies(TestPlugin intrinsics_gen)
add_dependencies(PluginsTests TestPlugin)
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(PluginsTests TestPlugin)
endif()