llvm-config.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. llvm-config - Print LLVM compilation options
  2. ============================================
  3. SYNOPSIS
  4. --------
  5. **llvm-config** *option* [*components*...]
  6. DESCRIPTION
  7. -----------
  8. **llvm-config** makes it easier to build applications that use LLVM. It can
  9. print the compiler flags, linker flags and object libraries needed to link
  10. against LLVM.
  11. EXAMPLES
  12. --------
  13. To link against the JIT:
  14. .. code-block:: sh
  15. g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
  16. g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
  17. `llvm-config --libs engine bcreader scalaropts`
  18. OPTIONS
  19. -------
  20. **--version**
  21. Print the version number of LLVM.
  22. **-help**
  23. Print a summary of **llvm-config** arguments.
  24. **--prefix**
  25. Print the installation prefix for LLVM.
  26. **--src-root**
  27. Print the source root from which LLVM was built.
  28. **--obj-root**
  29. Print the object root used to build LLVM.
  30. **--bindir**
  31. Print the installation directory for LLVM binaries.
  32. **--includedir**
  33. Print the installation directory for LLVM headers.
  34. **--libdir**
  35. Print the installation directory for LLVM libraries.
  36. **--cxxflags**
  37. Print the C++ compiler flags needed to use LLVM headers.
  38. **--ldflags**
  39. Print the flags needed to link against LLVM libraries.
  40. **--libs**
  41. Print all the libraries needed to link against the specified LLVM
  42. *components*, including any dependencies.
  43. **--libnames**
  44. Similar to **--libs**, but prints the bare filenames of the libraries
  45. without **-l** or pathnames. Useful for linking against a not-yet-installed
  46. copy of LLVM.
  47. **--libfiles**
  48. Similar to **--libs**, but print the full path to each library file. This is
  49. useful when creating makefile dependencies, to ensure that a tool is relinked if
  50. any library it uses changes.
  51. **--components**
  52. Print all valid component names.
  53. **--targets-built**
  54. Print the component names for all targets supported by this copy of LLVM.
  55. **--build-mode**
  56. Print the build mode used when LLVM was built (e.g. Debug or Release)
  57. COMPONENTS
  58. ----------
  59. To print a list of all available components, run **llvm-config
  60. --components**. In most cases, components correspond directly to LLVM
  61. libraries. Useful "virtual" components include:
  62. **all**
  63. Includes all LLVM libraries. The default if no components are specified.
  64. **backend**
  65. Includes either a native backend or the C backend.
  66. **engine**
  67. Includes either a native JIT or the bitcode interpreter.
  68. EXIT STATUS
  69. -----------
  70. If **llvm-config** succeeds, it will exit with 0. Otherwise, if an error
  71. occurs, it will exit with a non-zero value.