[CMake] Allow overriding MSVC_DIA_SDK_DIR via CMake
[llvm-core.git] / docs / CommandGuide / llvm-config.rst
blob159006685591926e7d632c9fe4a8e356bc6e2eee
1 llvm-config - Print LLVM compilation options
2 ============================================
4 .. program:: llvm-config
6 SYNOPSIS
7 --------
9 **llvm-config** *option* [*components*...]
11 DESCRIPTION
12 -----------
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
16 against LLVM.
18 EXAMPLES
19 --------
21 To link against the JIT:
23 .. code-block:: sh
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`
29 OPTIONS
30 -------
32 **--version**
34  Print the version number of LLVM.
36 **-help**
38  Print a summary of **llvm-config** arguments.
40 **--prefix**
42  Print the installation prefix for LLVM.
44 **--src-root**
46  Print the source root from which LLVM was built.
48 **--obj-root**
50  Print the object root used to build LLVM.
52 **--bindir**
54  Print the installation directory for LLVM binaries.
56 **--includedir**
58  Print the installation directory for LLVM headers.
60 **--libdir**
62  Print the installation directory for LLVM libraries.
64 **--cxxflags**
66  Print the C++ compiler flags needed to use LLVM headers.
68 **--ldflags**
70  Print the flags needed to link against LLVM libraries.
72 **--libs**
74  Print all the libraries needed to link against the specified LLVM
75  *components*, including any dependencies.
77 **--libnames**
79  Similar to **--libs**, but prints the bare filenames of the libraries
80  without **-l** or pathnames.  Useful for linking against a not-yet-installed
81  copy of LLVM.
83 **--libfiles**
85  Similar to **--libs**, but print the full path to each library file.  This is
86  useful when creating makefile dependencies, to ensure that a tool is relinked if
87  any library it uses changes.
89 **--components**
91  Print all valid component names.
93 **--targets-built**
95  Print the component names for all targets supported by this copy of LLVM.
97 **--build-mode**
99  Print the build mode used when LLVM was built (e.g. Debug or Release)
102 COMPONENTS
103 ----------
105 To print a list of all available components, run **llvm-config
106 --components**.  In most cases, components correspond directly to LLVM
107 libraries.  Useful "virtual" components include:
109 **all**
111  Includes all LLVM libraries.  The default if no components are specified.
113 **backend**
115  Includes either a native backend or the C backend.
117 **engine**
119  Includes either a native JIT or the bitcode interpreter.
122 EXIT STATUS
123 -----------
125 If **llvm-config** succeeds, it will exit with 0.  Otherwise, if an error
126 occurs, it will exit with a non-zero value.