llvm-config - Print LLVM compilation optionsΒΆ
SYNOPSISΒΆ
llvm-config option [componentsβ¦]
DESCRIPTIONΒΆ
llvm-config makes it easier to build applications that use LLVM. It can print the compiler flags, linker flags and object libraries needed to link against LLVM.
EXAMPLESΒΆ
To link against the JIT:
g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
`llvm-config --libs engine bcreader scalaropts`
OPTIONSΒΆ
βassertion-mode
Print the assertion mode used when LLVM was built (ON or OFF).
βbindir
Print the installation directory for LLVM binaries.
βbuild-mode
Print the build mode used when LLVM was built (e.g. Debug or Release).
βbuild-system
Print the build system used to build LLVM (e.g. cmake or gn).
βcflags
Print the C compiler flags needed to use LLVM headers.
βcmakedir
Print the installation directory for LLVM CMake modules.
βcomponents
Print all valid component names.
βcppflags
Print the C preprocessor flags needed to use LLVM headers.
βcxxflags
Print the C++ compiler flags needed to use LLVM headers.
βhas-rtti
Print whether or not LLVM was built with rtti (YES or NO).
βhelp
Print a summary of llvm-config arguments.
βhost-target
Print the target triple used to configure LLVM.
βignore-libllvm
Ignore libLLVM and link component libraries instead.
βincludedir
Print the installation directory for LLVM headers.
βldflags
Print the flags needed to link against LLVM libraries.
βlibdir
Print the installation directory for LLVM libraries.
βlibfiles
Similar to βlibs, but print the full path to each library file. This is useful when creating makefile dependencies, to ensure that a tool is relinked if any library it uses changes.
βlibnames
Similar to βlibs, but prints the bare filenames of the libraries without -l or pathnames. Useful for linking against a not-yet-installed copy of LLVM.
βlibs
Print all the libraries needed to link against the specified LLVM components, including any dependencies.
βlink-shared
Link the components as shared libraries.
βlink-static
Link the component libraries statically.
βobj-root
Print the object root used to build LLVM.
βprefix
Print the installation prefix for LLVM.
βshared-mode
Print how the provided components can be collectively linked (shared or static).
βsystem-libs
Print all the system libraries needed to link against the specified LLVM components, including any dependencies.
βtargets-built
Print the component names for all targets supported by this copy of LLVM.
βversion
Print the version number of LLVM.
COMPONENTSΒΆ
To print a list of all available components, run llvm-config βcomponents. In most cases, components correspond directly to LLVM libraries. Useful βvirtualβ components include:
all
Includes all LLVM libraries. The default if no components are specified.
backend
Includes either a native backend or the C backend.
engine
Includes either a native JIT or the bitcode interpreter.
EXIT STATUSΒΆ
If llvm-config succeeds, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value.