[PATCH] D57299: Include lib/Testing/ only if LLVM_INCLUDE_TESTS is enabled

Jiang Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 27 15:20:25 PST 2019


jiangyi added a comment.

@mgorny compiler-rt includes those tests depending on llvm/lib/Testing/ only if COMPILER_RT_INCLUDE_TESTS is enabled and one of the following cmake conditions is true:

1. NOT  COMPILER_RT_STANDALONE_BUILD
2. COMPILER_RT_HAS_LLVMTESTINGSUPPORT    (true if llvm/lib/Testing/ is built)

So compiler-rt can still build with test if we do not assume in-tree llvm + compiler-rt build always provides llvm/lib/Testing/ and let compiler-rt/cmake/Modules/CompilerRTUtils.cmake probes if the dependent library (libLLVMTestingSupport) exists regardless of in-tree or out-of-tree build.

The compiler-rt patch is as follow:

  diff --git a/lib/xray/tests/unit/CMakeLists.txt b/lib/xray/tests/unit/CMakeLists.txt
  index d10524b8d..fc083a9e4 100644
  --- a/lib/xray/tests/unit/CMakeLists.txt
  +++ b/lib/xray/tests/unit/CMakeLists.txt
  @@ -1,16 +1,16 @@
   set(TEST_SOURCES
     allocator_test.cc
     buffer_queue_test.cc
     function_call_trie_test.cc
     profile_collector_test.cc
     segmented_array_test.cc
     test_helpers.cc
     xray_unit_test_main.cc)
   
  -if (NOT COMPILER_RT_STANDALONE_BUILD OR COMPILER_RT_HAS_LLVMTESTINGSUPPORT)
  +if (COMPILER_RT_HAS_LLVMTESTINGSUPPORT)
     list(APPEND TEST_SOURCES
       fdr_controller_test.cc
       fdr_log_writer_test.cc)
   endif()
   
   add_xray_unittest(XRayTest SOURCES ${TEST_SOURCES})


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57299/new/

https://reviews.llvm.org/D57299





More information about the llvm-commits mailing list