您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

81 行
2.7KB

  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. Passing a Toolchain
  17. *******************
  18. In ``dds``, the default format of a toolchain is that of a single file that
  19. describes the entire toolchain, and uses the extension ``.tc.dds`` by
  20. convention. When running a build for a project, the ``dds`` executable will
  21. look for a file named ``toolchain.tc.dds`` by default, and will error out if
  22. this file does not exist. A different toolchain can be provided by passing the
  23. toolchain file for the ``--toolchain`` (or ``-T``) option on the command line::
  24. $ dds build -T my-toolchain.tc.dds
  25. Alternatively, you can pass the name of a built-in toolchain. See below.
  26. Built-in Toolchains
  27. *******************
  28. For convenience, ``dds`` includes several built-in toolchains that can be
  29. accessed in the ``--toolchain`` command-line option using a colon ``:``
  30. prefix::
  31. $ dds build -T :gcc
  32. ``dds`` will treat the leading colon (``:``) as a name for a built-in
  33. toolchain (this means that a toolchain's filepath may not begin with a colon).
  34. There are several built-in toolchains that may be specified:
  35. ``:gcc``
  36. Uses the default ``gcc`` and ``g++`` executables, linkers, and options
  37. thereof.
  38. ``:gcc-N`` (for some integer ``N``)
  39. Equivalent to ``:gcc``, but uses the ``gcc-N`` and ``g++-N`` executables.
  40. ``:clang``
  41. Equivalent to ``:gcc``, but uses the ``clang`` and ``clang++`` executables.
  42. ``:clang-N`` (for some integer ``N``)
  43. Equivalent to ``:clang``, but uses the ``clang-N`` and ``clang++-N``
  44. executables.
  45. ``:msvc``
  46. Compiles and links using the Visual C++ toolchain.
  47. The following pseudo-toolchains are also available:
  48. ``:ccache:XYZ``
  49. Uses built-in toolchain ``:XYZ``, but prefixes all compile commands with
  50. ``ccache``.
  51. .. note::
  52. **IMPORTANT**: ``dds`` will *not* automatically load the Visual C++
  53. environment. To use Visual C++, ``dds`` must be executed from the
  54. appropriate environment in order for the Visual C++ toolchain executables
  55. and files to be available.