.. _genbindings:

----------------------------
Generating language bindings
----------------------------

The :ref:`TurretApi.thrift <turretapithrift>` file should be quite consistent in its contents, however it is a good idea to set up the IDE to autogenerate the language bindings.

`Thrift tutorial <https://thrift.apache.org/tutorial/#generate-thrift-file-to-source-code>`_

The Thrift executable can be used to generate the language specific files from the interface definiton.

.. code-block:: none
    :caption: Basic command for generating language bindings

    C++: thrift --gen cpp TurretApi.thrift
    C#:  thrift --gen csharp TurretApi.thrift

Where ``thrift`` is the thrift executable. Optional parameters can be supplied for example to change the output destination (``-o <destination>``).
