Problem compiling llvm plugin: llvm/Config/llvm-config.h: No such file or directory

Viewed 1499

I've been trying to compile an llvm plugin. I've checked out the source code of llvm here and implemented a simple example e.g. based on this article. Upon compiling against llvm, I get the following error:

/mnt/d/Cpp/llvm-project/llvm/include/llvm/Support/Compiler.h:18:10: fatal error: llvm/Config/llvm-config.h: No such file or directory
   18 | #include "llvm/Config/llvm-config.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

If I check the Compiler.h file and the file that was supposed to be included, I find a very similarly named file: llvm-config.h.cmake. Is this an llvm bug or am I doing something wrong? Why is the llvm code written like this when it seems faulty?

1 Answers

As far as I understand it you need to build it with cmake than you can include <llvm/Config/llvm-config.h> I do not know if this will be the exact path but you can just simply search for the file after building it.

Related