README 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. build-clang.py
  2. ==============
  3. A script to build clang from source.
  4. ```
  5. usage: build-clang.py [-h] -c CONFIG [--clean]
  6. optional arguments:
  7. -h, --help show this help message and exit
  8. -c CONFIG, --config CONFIG
  9. Clang configuration file
  10. --clean Clean the build directory
  11. ```
  12. Pre-requisites
  13. --------------
  14. * Working build toolchain.
  15. * Subversion
  16. * CMake
  17. * Ninja
  18. * Python 2.7
  19. Please use the latest available CMake for your platform to avoid surprises.
  20. Config file format
  21. ------------------
  22. build-clang.py accepts a JSON config format with the following fields:
  23. * llvm_revision: The LLVM SVN revision to build.
  24. * stages: Use 1, 2, or 3 to select different compiler stages. The default is 3.
  25. * llvm_repo: SVN path to the LLVM repo.
  26. * clang_repo: SVN path to the Clang repo.
  27. * compiler_repo: SVN path to the compiler-rt repo.
  28. * libcxx_repo: SVN path to the libcxx repo.
  29. * libcxxabi_repo: SVN path to the libcxxabi repo.
  30. * python_path: Path to the Python 2.7 installation on the machine building clang.
  31. * gcc_dir: Path to the gcc toolchain installation, only required on Linux.
  32. * cc: Path to the bootsraping C Compiler.
  33. * cxx: Path to the bootsraping C++ Compiler.
  34. * patches: Optional list of patches to apply per platform. Supported platforms: macosx64, linux32, linux64. The default is Release.
  35. * build_type: The type of build to make. Supported types: Release, Debug, RelWithDebInfo or MinSizeRel.
  36. * build_libcxx: Whether to build with libcxx. The default is false.
  37. * assertions: Whether to enable LLVM assertions. The default is false.