[xray] Fix CMake for X-RAY tests

Correctly depend on llvm-xray, make sure unit tests are being run.

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

llvm-svn: 315827
This commit is contained in:
George Karpenkov 2017-10-14 21:38:13 +00:00
parent 6ecae9fc97
commit 1b11460610
1 changed files with 2 additions and 1 deletions

View File

@ -20,13 +20,14 @@ macro(add_xray_unittest testname)
generate_compiler_rt_tests(TEST_OBJECTS
XRayUnitTests "${testname}-${arch}-Test" "${arch}"
SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
DEPS gtest xray
DEPS gtest xray llvm-xray
CFLAGS ${XRAY_UNITTEST_CFLAGS}
LINK_FLAGS -fxray-instrument
${TARGET_LINK_FLAGS}
-lstdc++ -lm ${CMAKE_THREAD_LIBS_INIT}
-lpthread
-ldl -lrt)
set_target_properties(XRayUnitTests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endforeach()
endif()
endmacro()