2018-05-16 00:30:30 +08:00
|
|
|
# Needed by LLVM's CMake checks because this file defines multiple targets.
|
|
|
|
set(LLVM_OPTIONAL_SOURCES TestPlugin.cpp)
|
|
|
|
|
2018-04-05 23:04:13 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS Support Passes Core)
|
|
|
|
|
2018-04-26 04:16:24 +08: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-08 04:22:38 +08:00
|
|
|
if (LLVM_ENABLE_PLUGINS)
|
2018-04-26 04:16:24 +08:00
|
|
|
add_definitions(-DLLVM_ENABLE_PLUGINS)
|
|
|
|
endif()
|
2018-04-05 23:04:13 +08:00
|
|
|
|
2018-05-18 20:42:30 +08:00
|
|
|
add_llvm_unittest(PluginsTests
|
|
|
|
PluginsTest.cpp
|
|
|
|
)
|
2018-04-26 04:16:24 +08:00
|
|
|
export_executable_symbols(PluginsTests)
|
2018-04-05 23:04:13 +08:00
|
|
|
|
2018-05-18 20:42:30 +08:00
|
|
|
add_library(TestPlugin MODULE
|
|
|
|
TestPlugin.cpp
|
|
|
|
)
|
2018-04-05 23:04:13 +08:00
|
|
|
|
2018-04-26 04:16:24 +08: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 23:04:13 +08:00
|
|
|
|
2018-04-26 04:16:24 +08:00
|
|
|
set_target_properties(TestPlugin
|
|
|
|
PROPERTIES PREFIX ""
|
2018-05-17 00:29:05 +08:00
|
|
|
SUFFIX ${LTDL_SHLIB_EXT}
|
2018-04-26 04:16:24 +08:00
|
|
|
)
|
2018-05-03 02:57:14 +08:00
|
|
|
set_target_properties(TestPlugin PROPERTIES FOLDER "Tests")
|
2018-04-06 01:20:45 +08:00
|
|
|
|
2018-04-26 04:16:24 +08: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-06 01:20:45 +08:00
|
|
|
endif()
|
2018-04-26 04:16:24 +08:00
|
|
|
|
|
|
|
add_dependencies(TestPlugin intrinsics_gen)
|
|
|
|
add_dependencies(PluginsTests TestPlugin)
|