From: Dean Michael Berris Date: Tue, 6 Dec 2016 09:43:44 +0000 (+0000) Subject: [XRay][compiler-rt] Only add unit tests if we're building XRay. X-Git-Tag: llvmorg-4.0.0-rc1~2877 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=406200eae625285ded18e3eb6cb17a12162742de;p=platform%2Fupstream%2Fllvm.git [XRay][compiler-rt] Only add unit tests if we're building XRay. As constructed before this patch, in case we run into case where we don't actually build the XRay library, we really ought to not be adding the unit test runs. This should fix the bootstrap build failures. This is a follow-up further to D26232. llvm-svn: 288788 --- diff --git a/compiler-rt/lib/xray/tests/CMakeLists.txt b/compiler-rt/lib/xray/tests/CMakeLists.txt index cdccd77..72bfb91 100644 --- a/compiler-rt/lib/xray/tests/CMakeLists.txt +++ b/compiler-rt/lib/xray/tests/CMakeLists.txt @@ -53,6 +53,6 @@ macro(add_xray_unittest testname) endif() endmacro() -if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID) +if(COMPILER_RT_CAN_EXECUTE_TESTS) add_subdirectory(unit) endif() diff --git a/compiler-rt/test/xray/CMakeLists.txt b/compiler-rt/test/xray/CMakeLists.txt index 8c4d3b5..5def7e3 100644 --- a/compiler-rt/test/xray/CMakeLists.txt +++ b/compiler-rt/test/xray/CMakeLists.txt @@ -23,14 +23,12 @@ if (COMPILER_RT_BUILD_XRAY AND COMPILER_RT_HAS_XRAY) ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND XRAY_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() -endif() -# Add unit tests. -if(COMPILER_RT_INCLUDE_TESTS) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) - if (COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID) + # Add unit tests. + if(COMPILER_RT_INCLUDE_TESTS) + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) list(APPEND XRAY_TEST_DEPS XRayUnitTests) list(APPEND XRAY_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) endif()