[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library
[llvm-core.git] / unittests / Passes / CMakeLists.txt
blob3e83b527958a65f0289da572b0144b13443671ef
1 # Needed by LLVM's CMake checks because this file defines multiple targets.
2 set(LLVM_OPTIONAL_SOURCES PluginsTest.cpp TestPlugin.cpp)
4 # If plugins are disabled, this test will disable itself at runtime. Otherwise,
5 # reconfiguring with plugins disabled will leave behind a stale executable.
6 if (LLVM_ENABLE_PLUGINS)
7   add_definitions(-DLLVM_ENABLE_PLUGINS)
8 endif()
10 set(LLVM_LINK_COMPONENTS Support Passes Core)
11 add_llvm_unittest(PluginsTests
12   PluginsTest.cpp
13   )
14 export_executable_symbols(PluginsTests)
15 target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport)
17 set(LLVM_LINK_COMPONENTS)
18 add_llvm_library(TestPlugin MODULE BUILDTREE_ONLY
19   TestPlugin.cpp
20   )
22 # Put plugin next to the unit test executable.
23 set_output_directory(TestPlugin
24   BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
25   LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
26   )
27 set_target_properties(TestPlugin PROPERTIES FOLDER "Tests")
29 add_dependencies(TestPlugin intrinsics_gen)
30 add_dependencies(PluginsTests TestPlugin)