add_custom_target(LLDBUnitTests)
set_target_properties(LLDBUnitTests PROPERTIES FOLDER "LLDB tests")

include_directories(${LLDB_SOURCE_ROOT})

set(LLDB_GTEST_COMMON_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/gtest_common.h)
if (MSVC)
  list(APPEND LLVM_COMPILE_FLAGS /FI ${LLDB_GTEST_COMMON_INCLUDE})
else ()
  list(APPEND LLVM_COMPILE_FLAGS -include ${LLDB_GTEST_COMMON_INCLUDE})
endif ()

include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)

function(add_lldb_unittest test_name)
  add_unittest(LLDBUnitTests
    ${test_name}
    ${ARGN}
    )

  if (MSVC)
    target_link_libraries(${test_name} ${PYTHON_LIBRARY})
  endif()

  lldb_link_common_libs(${test_name} EXE)
  target_link_libraries(${test_name} ${CLANG_USED_LIBS})
  llvm_config(${test_name} ${LLVM_LINK_COMPONENTS})
endfunction()

add_subdirectory(Host)
add_subdirectory(Interpreter)
add_subdirectory(Plugins)
add_subdirectory(Utility)

add_custom_target(LLDBUnitTests)
set_target_properties(LLDBUnitTests PROPERTIES FOLDER "LLDB tests")

include_directories(${LLDB_SOURCE_ROOT})

set(LLDB_GTEST_COMMON_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/gtest_common.h)
if (MSVC)
  list(APPEND LLVM_COMPILE_FLAGS /FI ${LLDB_GTEST_COMMON_INCLUDE})
else ()
  list(APPEND LLVM_COMPILE_FLAGS -include ${LLDB_GTEST_COMMON_INCLUDE})
endif ()

include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)

function(add_lldb_unittest test_name)
  add_unittest(LLDBUnitTests
    ${test_name}
    ${ARGN}
    )

  if (MSVC)
    target_link_libraries(${test_name} ${PYTHON_LIBRARY})
  endif()

  lldb_link_common_libs(${test_name} EXE)
  target_link_libraries(${test_name} ${CLANG_USED_LIBS} ${LLDB_SYSTEM_LIBS})
  llvm_config(${test_name} ${LLVM_LINK_COMPONENTS})
endfunction()

add_subdirectory(Host)
add_subdirectory(Interpreter)
add_subdirectory(Plugins)
add_subdirectory(Utility)

Add missing libraries to unittest link
Add missing libraries to unittest link

Summary:
Currently, linking of the unittests fails on linux because it is missing a bunch of symbols from
libedit, curses, etc. This fixes the build by adding the correct dependencies.

Test Plan: Linking works, unit tests run.

Reviewers: zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9244

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@235853 91177308-0d34-0410-b5e6-96231b3b80d8
