2018-04-05 17:04:13 +02:00
|
|
|
set(LLVM_LINK_COMPONENTS Support Passes Core)
|
|
|
|
|
2018-04-25 22:16:24 +02:00
|
|
|
# If plugins are disabled, this test will disable itself at runtime. Otherwise,
|
|
|
|
# reconfiguring with plugins disabled will leave behind a stale executable.
|
2018-04-07 22:22:38 +02:00
|
|
|
if (LLVM_ENABLE_PLUGINS)
|
2018-04-25 22:16:24 +02:00
|
|
|
add_definitions(-DLLVM_ENABLE_PLUGINS)
|
|
|
|
endif()
|
2018-04-05 17:04:13 +02:00
|
|
|
|
2018-04-25 22:16:24 +02:00
|
|
|
add_llvm_unittest(PluginsTests PluginsTest.cpp)
|
|
|
|
export_executable_symbols(PluginsTests)
|
2018-04-05 17:04:13 +02:00
|
|
|
|
2018-04-25 22:16:24 +02:00
|
|
|
add_library(TestPlugin MODULE TestPlugin.cxx)
|
2018-04-05 17:04:13 +02:00
|
|
|
|
2018-04-25 22:16:24 +02:00
|
|
|
set_output_directory(TestPlugin
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
|
|
|
|
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
|
|
|
|
)
|
2018-04-05 17:04:13 +02:00
|
|
|
|
2018-04-25 22:16:24 +02:00
|
|
|
set_target_properties(TestPlugin
|
|
|
|
PROPERTIES PREFIX ""
|
|
|
|
SUFFIX ".so"
|
|
|
|
)
|
2018-05-02 20:57:14 +02:00
|
|
|
set_target_properties(TestPlugin PROPERTIES FOLDER "Tests")
|
2018-04-05 19:20:45 +02:00
|
|
|
|
2018-04-25 22:16:24 +02:00
|
|
|
if (WIN32 OR CYGWIN OR LLVM_EXPORT_SYMBOLS_FOR_PLUGINS)
|
|
|
|
llvm_map_components_to_libnames(LLVM_DEPS ${LLVM_LINK_COMPONENTS})
|
|
|
|
target_link_libraries(TestPlugin ${LLVM_DEPS})
|
2018-04-05 19:20:45 +02:00
|
|
|
endif()
|
2018-04-25 22:16:24 +02:00
|
|
|
|
|
|
|
add_dependencies(TestPlugin intrinsics_gen)
|
|
|
|
add_dependencies(PluginsTests TestPlugin)
|