[clang] [Clang] Include LLVM CodeGen CMake file (PR #109601)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 22:10:32 PDT 2024


================
@@ -1,3 +1,7 @@
+if(EXISTS ${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen AND CLANG_BUILT_STANDALONE)
+  add_subdirectory(${LLVM_MAIN_SRC_DIR}/include/llvm/CodeGen llvm/lib/CodeGen)
+endif()
----------------
compnerd wrote:

The issue is that the `vt_gen` target is undefined. This is _expected_. The target should be defined by LLVM, which is a dependency. You should be wiring up the targets from LLVM into the clang build, which would provide the dependency and avoid this issue. The target definition is setup by `find_package(LLVM)` which is why you need to specify `-D LLVM_DIR=...` to the CMake invocation when configuring clang standalone. The normal build is unified and the target is defined when clang is configured.

https://github.com/llvm/llvm-project/pull/109601


More information about the cfe-commits mailing list