Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

85 lines
2.9KB

  1. Toolchains
  2. ##########
  3. One of the core components of ``dds`` is that of the *toolchain*. A toolchain
  4. encompasses the environment used to build and link source code, including, but
  5. not limited to:
  6. #. The executable binaries that constitute the language implementation:
  7. Compilers, linkers, and archive managers.
  8. #. The configuration of those tools, including most options given to those
  9. tools when they are invoked.
  10. #. The set of preprocessor macros and language features that are active during
  11. compilation.
  12. When a build is run, every file in the entire tree (including dependencies)
  13. will be compiled, archived, and linked using the same toolchain.
  14. This page provides an introduction on how one can make use of toolchains most
  15. effectively in your project.
  16. .. note::
  17. **IMPORTANT**: ``dds`` will *not* automatically load the Visual C++
  18. environment. To use Visual C++, ``dds`` must be executed from the
  19. appropriate environment in order for the Visual C++ toolchain executables
  20. and files to be available.
  21. Passing a Toolchain
  22. *******************
  23. In ``dds``, the default format of a toolchain is that of a single file that
  24. describes the entire toolchain, and uses the extension ``.tc.dds`` by
  25. convention. When running a build for a project, the ``dds`` executable will
  26. look for a file named ``toolchain.tc.dds`` by default, and will error out if
  27. this file does not exist. A different toolchain can be provided by passing the
  28. toolchain file for the ``--toolchain`` (or ``-t``) option on the command line::
  29. $ dds build -t my-toolchain.tc.dds
  30. Alternatively, you can pass the name of a built-in toolchain. See below.
  31. Built-in Toolchains
  32. *******************
  33. For convenience, ``dds`` includes several built-in toolchains that can be
  34. accessed in the ``--toolchain`` command-line option using a colon ``:``
  35. prefix::
  36. $ dds build -T :gcc
  37. ``dds`` will treat the leading colon (``:``) as a name for a built-in
  38. toolchain (this means that a toolchain's filepath may not begin with a colon).
  39. There are several built-in toolchains that may be specified:
  40. ``:gcc``
  41. Uses the default ``gcc`` and ``g++`` executables, linkers, and options
  42. thereof.
  43. ``:gcc-N`` (for some integer ``N``)
  44. Equivalent to ``:gcc``, but uses the ``gcc-N`` and ``g++-N`` executables.
  45. ``:clang``
  46. Equivalent to ``:gcc``, but uses the ``clang`` and ``clang++`` executables.
  47. ``:clang-N`` (for some integer ``N``)
  48. Equivalent to ``:clang``, but uses the ``clang-N`` and ``clang++-N``
  49. executables.
  50. ``:msvc``
  51. Compiles and links using the Visual C++ toolchain.
  52. The following pseudo-toolchains are also available:
  53. ``:debug:XYZ``
  54. Uses built-in toolchain ``:XYZ``, but generates debugging information.
  55. ``:ccache:XYZ``
  56. Uses built-in toolchain ``:XYZ``, but prefixes all compile commands with
  57. ``ccache``.
  58. ``:c++UV:XYZ`` (for two integers ``UV``)
  59. Sets the C++ version to ``C++UV`` and uses the ``:XYZ`` toolchain.