.. _Reusing Configuration Files:

Reusing Configuration Files
==============================

.. rst-class:: lead

  DVT can reuse configuration files in order to integrate existing IPs with additional logic, creating a complete project without starting from scratch.


Instead of explicitly specifying lists of files, incdirs etc., you can use one or more ``+dvt_include_config`` directives in the **default.build**. For example:

.. code-block::
    :emphasize-text: +dvt_include_config

    # Use the build file to identify compilation arguments;
    +dvt_include_config+/path/to/project/.dvt/default.build

    # Identify compilation arguments and compile sources based on the build file matched with the specified environment variable
    +dvt_include_config+$ENV_VAR/.dvt/default.build

.. warning::
    
    ``+dvt_include_config`` argument path must be situated under a **.dvt** folder


DVT scans specified configuration files and emulates the environment of the project configured using them. Paths and directives used in the configuration are resolved relative to the included IP **compilation root**.



Each ``+dvt_include_config`` directive usage is equivalent with a new :ref:`invocation <Emulating compiler invocations>` that sets the environment for the included configuration file.

.. note::
    
    ``+dvt_include_config`` are loaded before any other invocation in the including project, except for the implicit one. 