2018-05-15 18:30:30 +02:00
|
|
|
# Needed by LLVM's CMake checks because this file defines multiple targets.
|
2021-06-25 15:37:02 +02:00
|
|
|
set(LLVM_OPTIONAL_SOURCES PluginsTest.cpp TestPlugin.cpp DoublerPlugin.cpp PassBuilderBindingsTest.cpp)
|
2018-04-05 17:04:13 +02:00
|
|
|
|
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
|
|
|
|
2020-02-05 12:53:56 +01:00
|
|
|
# The plugin expects to not link against the Support and Core libraries,
|
|
|
|
# but expects them to exist in the process loading the plugin. This doesn't
|
|
|
|
# work with DLLs on Windows (where a shared library can't have undefined
|
|
|
|
# references), so just skip this testcase on Windows.
|
|
|
|
if (NOT WIN32)
|
2021-07-07 15:56:15 +02:00
|
|
|
set(LLVM_LINK_COMPONENTS Support Passes Core AsmParser)
|
2020-02-05 12:53:56 +01:00
|
|
|
add_llvm_unittest(PluginsTests
|
|
|
|
PluginsTest.cpp
|
|
|
|
)
|
2020-03-20 22:00:19 +01:00
|
|
|
export_executable_symbols_for_plugins(PluginsTests)
|
2021-07-07 04:46:21 +02:00
|
|
|
target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport)
|
2018-04-05 17:04:13 +02:00
|
|
|
|
2020-02-05 12:53:56 +01:00
|
|
|
set(LLVM_LINK_COMPONENTS)
|
2021-06-25 15:37:02 +02:00
|
|
|
foreach(PLUGIN TestPlugin DoublerPlugin)
|
|
|
|
add_llvm_library(${PLUGIN} MODULE BUILDTREE_ONLY ${PLUGIN}.cpp)
|
2018-04-05 17:04:13 +02:00
|
|
|
|
2021-06-25 15:37:02 +02:00
|
|
|
# Put PLUGIN next to the unit test executable.
|
|
|
|
set_output_directory(${PLUGIN}
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
|
|
|
|
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
|
|
|
|
)
|
|
|
|
set_target_properties(${PLUGIN} PROPERTIES FOLDER "Tests")
|
|
|
|
|
|
|
|
add_dependencies(${PLUGIN} intrinsics_gen)
|
|
|
|
add_dependencies(PluginsTests ${PLUGIN})
|
|
|
|
endforeach()
|
2018-09-13 22:24:36 +02:00
|
|
|
|
2020-02-05 12:53:56 +01:00
|
|
|
endif()
|
2021-05-17 20:03:47 +02:00
|
|
|
|
2021-05-18 18:33:50 +02:00
|
|
|
set(LLVM_LINK_COMPONENTS Support Passes Core Target native AllTargetsInfos)
|
2021-05-18 19:39:12 +02:00
|
|
|
add_llvm_unittest(PassesBindingsTests
|
|
|
|
PassBuilderBindingsTest.cpp
|
|
|
|
)
|
2021-05-18 18:33:50 +02:00
|
|
|
target_link_libraries(PassesBindingsTests PRIVATE LLVMTestingSupport)
|
2021-06-25 15:37:02 +02:00
|
|
|
|