set(LLVM_LINK_COMPONENTS Support Passes Core)

# If plugins are disabled, this test will disable itself at runtime. Otherwise,
# reconfiguring with plugins disabled will leave behind a stale executable.
if (LLVM_ENABLE_PLUGINS)
  add_definitions(-DLLVM_ENABLE_PLUGINS)
endif()

add_llvm_unittest(PluginsTests PluginsTest.cpp)
export_executable_symbols(PluginsTests)

add_library(TestPlugin MODULE TestPlugin.cxx)

set_output_directory(TestPlugin
  BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
  LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
  )

set_target_properties(TestPlugin
  PROPERTIES PREFIX ""
  SUFFIX ".so"
  )

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})
endif()

add_dependencies(TestPlugin intrinsics_gen)
add_dependencies(PluginsTests TestPlugin)

set(LLVM_LINK_COMPONENTS Support Passes Core)

# If plugins are disabled, this test will disable itself at runtime. Otherwise,
# reconfiguring with plugins disabled will leave behind a stale executable.
if (LLVM_ENABLE_PLUGINS)
  add_definitions(-DLLVM_ENABLE_PLUGINS)
endif()

add_llvm_unittest(PluginsTests PluginsTest.cpp)
export_executable_symbols(PluginsTests)

add_library(TestPlugin MODULE TestPlugin.cxx)

set_output_directory(TestPlugin
  BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
  LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
  )

set_target_properties(TestPlugin
  PROPERTIES PREFIX ""
  SUFFIX ".so"
  )
set_target_properties(TestPlugin PROPERTIES FOLDER "Tests")

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})
endif()

add_dependencies(TestPlugin intrinsics_gen)
add_dependencies(PluginsTests TestPlugin)

Move the TestPlugin project into the Tests folder in CMake.
Move the TestPlugin project into the Tests folder in CMake.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@331387 91177308-0d34-0410-b5e6-96231b3b80d8
