1 llvm-config - Print LLVM compilation options
2 ============================================
4 .. program:: llvm-config
9 **llvm-config** *option* [*components*...]
14 **llvm-config** makes it easier to build applications that use LLVM. It can
15 print the compiler flags, linker flags and object libraries needed to link
21 To link against the JIT:
25 g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
26 g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
27 `llvm-config --libs engine bcreader scalaropts`
34 Print the assertion mode used when LLVM was built (ON or OFF).
38 Print the installation directory for LLVM binaries.
42 Print the build mode used when LLVM was built (e.g. Debug or Release).
46 Print the build system used to build LLVM (e.g. `cmake` or `gn`).
50 Print the C compiler flags needed to use LLVM headers.
54 Print the installation directory for LLVM CMake modules.
58 Print all valid component names.
62 Print the C preprocessor flags needed to use LLVM headers.
66 Print the C++ compiler flags needed to use LLVM headers.
70 Print whether or not LLVM was built with rtti (YES or NO).
74 Print a summary of **llvm-config** arguments.
78 Print the target triple used to configure LLVM.
82 Ignore libLLVM and link component libraries instead.
86 Print the installation directory for LLVM headers.
90 Print the flags needed to link against LLVM libraries.
94 Print the installation directory for LLVM libraries.
98 Similar to **--libs**, but print the full path to each library file. This is
99 useful when creating makefile dependencies, to ensure that a tool is relinked if
100 any library it uses changes.
104 Similar to **--libs**, but prints the bare filenames of the libraries
105 without **-l** or pathnames. Useful for linking against a not-yet-installed
110 Print all the libraries needed to link against the specified LLVM
111 *components*, including any dependencies.
115 Link the components as shared libraries.
119 Link the component libraries statically.
123 Print the object root used to build LLVM.
127 Print the installation prefix for LLVM.
131 Print how the provided components can be collectively linked (`shared` or `static`).
135 Print all the system libraries needed to link against the specified LLVM
136 *components*, including any dependencies.
140 Print the component names for all targets supported by this copy of LLVM.
144 Print the version number of LLVM.
150 To print a list of all available components, run **llvm-config
151 --components**. In most cases, components correspond directly to LLVM
152 libraries. Useful "virtual" components include:
156 Includes all LLVM libraries. The default if no components are specified.
160 Includes either a native backend or the C backend.
164 Includes either a native JIT or the bitcode interpreter.
170 If **llvm-config** succeeds, it will exit with 0. Otherwise, if an error
171 occurs, it will exit with a non-zero value.