| 1 |
# Needed by LLVM's CMake checks because this file defines multiple targets. |
| 2 |
set(LLVM_OPTIONAL_SOURCES PluginsTest.cpp TestPlugin.cpp DoublerPlugin.cpp PassBuilderBindingsTest.cpp) |
| 3 |
|
| 4 |
# The plugin expects to not link against the Support and Core libraries, |
| 5 |
# but expects them to exist in the process loading the plugin. This doesn't |
| 6 |
# work with DLLs on Windows (where a shared library can't have undefined |
| 7 |
# references), so just skip this testcase on Windows. |
| 8 |
if (NOT WIN32) |
| 9 |
# On AIX, enable run-time linking to allow symbols from the plugins shared |
| 10 |
# objects to be properly bound. |
| 11 |
if(CMAKE_SYSTEM_NAME STREQUAL "AIX") |
| 12 |
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-brtl") |
| 13 |
endif() |
| 14 |
set(LLVM_LINK_COMPONENTS Support Passes Core AsmParser) |
| 15 |
add_llvm_unittest(PluginsTests |
| 16 |
PluginsTest.cpp |
| 17 |
) |
| 18 |
export_executable_symbols_for_plugins(PluginsTests) |
| 19 |
target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport) |
| 20 |
|
| 21 |
set(LLVM_LINK_COMPONENTS) |
| 22 |
foreach(PLUGIN TestPlugin DoublerPlugin) |
| 23 |
add_llvm_library(${PLUGIN} MODULE BUILDTREE_ONLY ${PLUGIN}.cpp) |
| 24 |
|
| 25 |
# Put PLUGIN next to the unit test executable. |
| 26 |
set_output_directory(${PLUGIN} |
| 27 |
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} |
| 28 |
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} |
| 29 |
) |
| 30 |
set_target_properties(${PLUGIN} PROPERTIES FOLDER "Tests") |
| 31 |
|
| 32 |
add_dependencies(${PLUGIN} intrinsics_gen) |
| 33 |
add_dependencies(PluginsTests ${PLUGIN}) |
| 34 |
endforeach() |
| 35 |
|
| 36 |
endif() |
| 37 |
|
| 38 |
set(LLVM_LINK_COMPONENTS Support Passes Core Target native AllTargetsInfos) |
| 39 |
add_llvm_unittest(PassesBindingsTests |
| 40 |
PassBuilderBindingsTest.cpp |
| 41 |
) |
| 42 |
target_link_libraries(PassesBindingsTests PRIVATE LLVMTestingSupport) |
| 43 |
|