[PATCH] D137024: [compiler-rt] Switch from llvm-config to find_package(LLVM)

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 29 11:34:26 PDT 2022


mgorny added inline comments.


================
Comment at: compiler-rt/lib/xray/tests/CMakeLists.txt:68-80
+    if (COMPILER_RT_HAS_LLVMXRAY OR COMPILER_RT_HAS_LLVMTESTINGSUPPORT)
+      if (LLVM_LINK_LLVM_DYLIB)
+        list(APPEND XRAY_UNITTEST_LINK_FLAGS -lLLVM)
+      endif()
+    else()
+      if (COMPILER_RT_HAS_LLVMXRAY)
+        list(APPEND XRAY_UNITTEST_LINK_FLAGS -lLLVMXRay)
----------------
phosek wrote:
> Rather than manually linking against libraries and their dependencies (which may change over time and break this code), we should use import targets provided by the LLVM CMake config: `LLVMXRay` and `LLVMTestingSupport`. That can be done in a follow up change though.
I actually wanted to do that but couldn't figure out how. Perhaps my approach was wrong, as I was trying to get linked libraries out of target properties.


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

https://reviews.llvm.org/D137024



More information about the cfe-commits mailing list