diff options
-rw-r--r-- | compiler-rt/lib/xray/tests/CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler-rt/lib/xray/tests/CMakeLists.txt b/compiler-rt/lib/xray/tests/CMakeLists.txt index b5c7d8fa7e5..b73c15bed4c 100644 --- a/compiler-rt/lib/xray/tests/CMakeLists.txt +++ b/compiler-rt/lib/xray/tests/CMakeLists.txt @@ -3,6 +3,12 @@ include_directories(..) add_custom_target(XRayUnitTests) set_target_properties(XRayUnitTests PROPERTIES FOLDER "XRay unittests") +# Create an XRAY_IMPL_FILES variable which will include all the implementation +# files that are in the lib directory. Unfortunately, when new files are added +# to the implementation, CMake must be run so that this variable is +# re-generated. +file(GLOB XRAY_IMPL_FILES "../*.cc" "../*.h") + set(XRAY_UNITTEST_CFLAGS ${XRAY_CFLAGS} ${COMPILER_RT_UNITTEST_CFLAGS} @@ -24,6 +30,11 @@ macro(add_xray_unittest testname) generate_compiler_rt_tests(TEST_OBJECTS XRayUnitTests "${testname}-${arch}-Test" "${arch}" SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE} + # Note that any change in the implementations will cause all the unit + # tests to be re-built. This is by design, but may be cumbersome during + # the build/test cycle. + COMPILE_DEPS ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE} + ${XRAY_HEADERS} ${XRAY_IMPL_FILES} DEPS gtest xray llvm-xray CFLAGS ${XRAY_UNITTEST_CFLAGS} LINK_FLAGS -fxray-instrument |