-
Hi everyone, I have trouble integrating the LLVM package into my project. Here’s the segment I used in my CMakeLists.txt:
When I wrote the following code, #include <llvm/IR/PassManager.h>
namespace llvm {
class HelloWorldPass : public PassInfoMixin<HelloWorldPass> {
public:
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
} // namespace llvm I got the following build output:
Has anyone integrated LLVM into their project before? How did you set the configuration? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
One immediate issue is that the llvm-project repository does not have a top-level CMakeLists.txt file. To resolve this, you need to use the SOURCE_SUBDIR argument to specify the location of the CMakeLists.txt file within the repository. Since I am not deeply familiar with the llvm-project structure, there might be additional adjustments required. |
Beta Was this translation helpful? Give feedback.
Sorry for the late response.
I'm not very familiar with LLVM's setup, and unfortunately, I don't have the time to look into it in detail. Sorry about that.
However, my intuition is that LLVM may not be easily usable with CPM, at least without significant configuration effort. From what I’ve seen in the examples, LLVM seems to be designed for integration using
find_package
. The recommended approach would be to install LLVM separately so thatfind_package
can locate the installed version. After that, you can directly use the binaries, libraries, ... in your project.CPM, on the other hand, is great for adding dependencies that you can built alongside your project. This approach works well f…