llvm-config.rst 2.6 KB

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