Problem in LLVM CMake modules

Well for one thing, it gives one example of a CMakeLists.txt file that correctly uses LLVM, and nothing else. It gives no information on how to find out what set of components I need to map for what APIs.

Neither does llvm-config list out the names of the actual components. I can use either the CMake modules or llvm-config to find the library names once I've got the component names, but as far as I can tell, there's no actual documentation of the component names themselves anywhere.

Eli Gottlieb <eligottlieb@gmail.com> writes:

Well for one thing, it gives one example of a CMakeLists.txt file that
correctly uses LLVM, and nothing else. It gives no information on how
to find out what set of components I need to map for what APIs.

Component == Library (case insensitive and without the library file
decoration, i.e. no prepended `lib' nor appended `.a' or `.lib') There
are a few special component names (i.e. native) that maps to different
libraries depending on the platform. That's all.

Neither does llvm-config list out the names of the actual components. I
can use either the CMake modules or llvm-config to find the library
names once I've got the component names, but as far as I can tell,
there's no actual documentation of the component names themselves anywhere.

It is true that there is no easy way to determine which library contains
a given API. There was quite a bit of grepping and doxygen navigation
here for locating class definitions and thus guessing the required
library when I coded my compiler.

What llvm-config and the corresponding CMake functions does for you is,
once given a list of components (i.e. jit native bitreader) figure out
the corresponding libraries (which is easy enough, as mentioned above)
and, more important, bring in all the other libraries that your desired
components depend on.