add_custom_target(ExtraToolsUnitTests)
set_target_properties(ExtraToolsUnitTests PROPERTIES FOLDER "Extra Tools Unit Tests")

function(add_extra_unittest test_dirname)
  add_unittest(ExtraToolsUnitTests ${test_dirname} ${ARGN})
endfunction()

add_subdirectory(change-namespace)
add_subdirectory(clang-apply-replacements)
add_subdirectory(clang-move)
add_subdirectory(clang-query)
if(CLANG_ENABLE_STATIC_ANALYZER)
  add_subdirectory(clang-tidy)
endif()
add_subdirectory(clangd)
add_subdirectory(include-fixer)

add_custom_target(ExtraToolsUnitTests)
set_target_properties(ExtraToolsUnitTests PROPERTIES FOLDER "Extra Tools Unit Tests")

function(add_extra_unittest test_dirname)
  add_unittest(ExtraToolsUnitTests ${test_dirname} ${ARGN})
endfunction()

if(CLANG_BUILT_STANDALONE)
  # LLVMTestingSupport library is needed for clangd tests.
  if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
      AND NOT TARGET LLVMTestingSupport)
    add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
      lib/Testing/Support)
  endif()
endif()

add_subdirectory(change-namespace)
add_subdirectory(clang-apply-replacements)
add_subdirectory(clang-move)
add_subdirectory(clang-query)
if(CLANG_ENABLE_STATIC_ANALYZER)
  add_subdirectory(clang-tidy)
endif()
add_subdirectory(clangd)
add_subdirectory(include-fixer)

Include LLVMTestingSupport when doing stand-alone build
[cmake] Include LLVMTestingSupport when doing stand-alone build

Explicitly include and build lib/Testing/Support from LLVM sources when
doing a stand-alone build. This is necessary since clangd tests started
to depend on LLVMTestingSupport library which is neither installed
by LLVM, nor built by clang itself.

Since completely separate build of clang-tools-extra is not supported,
this relies on variables set by clang CMakeLists.

Differential Revision: https://reviews.llvm.org/D45409

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@329594 91177308-0d34-0410-b5e6-96231b3b80d8
