set(LLVM_LINK_COMPONENTS
  Support
  XRay
  TestingSupport
  )

add_llvm_unittest(XRayTests
  FDRBlockIndexerTest.cpp
  FDRBlockVerifierTest.cpp
  FDRProducerConsumerTest.cpp
  FDRRecordPrinterTest.cpp
  FDRRecordsTest.cpp
  FDRTraceWriterTest.cpp
  GraphTest.cpp
  ProfileTest.cpp
  )

add_dependencies(XRayTests intrinsics_gen)
target_link_libraries(XRayTests PRIVATE LLVMTestingSupport)

set(LLVM_LINK_COMPONENTS
  Support
  XRay
  )

add_llvm_unittest(XRayTests
  FDRBlockIndexerTest.cpp
  FDRBlockVerifierTest.cpp
  FDRProducerConsumerTest.cpp
  FDRRecordPrinterTest.cpp
  FDRRecordsTest.cpp
  FDRTraceWriterTest.cpp
  GraphTest.cpp
  ProfileTest.cpp
  )

add_dependencies(XRayTests intrinsics_gen)
target_link_libraries(XRayTests PRIVATE LLVMTestingSupport)

Fix the build when LLVM_TARGETS_TO_BUILD is empty.
Fix the build when LLVM_TARGETS_TO_BUILD is empty.

Using LLVMTestingSupport in the LLVM_LINK_COMPONENTS breaks the build when
LLVM_TARGETS_TO_BUILD is set to empty.

Libraries that depend on LLVMTestingSupport need to use
target_link_libraries(<target> PRIVATE LLVMTestingSupport) instead.

This required change was already commited by r341899 to fix another build
issue.

This fixes rdar://problem/44615064.

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