<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Derive configs &mdash; bake 2.13.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootswatch-3.3.4/sandstone/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.13.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="../_static/js/jquery-fix.js"></script>
    <script type="text/javascript" src="../_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
    <link rel="shortcut icon" href="../_static/logo_tiny_32.ico"/>
    <link rel="top" title="bake 2.13.0 documentation" href="../index.html" />
    <link rel="up" title="Syntax" href="syntax.html" />
    <link rel="next" title="Commandline" href="../commandline/commandline.html" />
    <link rel="prev" title="Variables in Project.meta" href="variable_substitutions.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">

  </head>
  <body role="document">

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="../index.html"><img src="../_static/logo_conformant_48.png">
           </a>
        <span class="navbar-text navbar-version pull-left"><b></b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="../index.html">Section <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../why_bake/why_bake.html">Why you should use bake</a></li>
<li class="toctree-l1"><a class="reference internal" href="../install/install_bake.html">Install bake</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/quickstart.html">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="../concepts/concepts.html">Concepts</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="syntax.html">Syntax</a></li>
<li class="toctree-l1"><a class="reference internal" href="../commandline/commandline.html">Commandline</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ide/ide_integrations.html">IDE Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tips_and_tricks/tips_and_tricks.html">Tips and Tricks</a></li>
<li class="toctree-l1"><a class="reference internal" href="../performance/performance.html">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="../known_issues.html">Known Issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../internal.html">Internal developing notes</a></li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">SubSections <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">Derive configs</a><ul>
<li><a class="reference internal" href="#deriving-a-config">Deriving a config</a></li>
<li><a class="reference internal" href="#inheritance-implications">Inheritance implications</a></li>
</ul>
</li>
</ul>
</ul>
</li>
              
            
            
              
                
  <li>
    <a href="variable_substitutions.html" title="Previous Chapter: Variables in Project.meta"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Variables in ...</span>
    </a>
  </li>
  <li>
    <a href="../commandline/commandline.html" title="Next Chapter: Commandline"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Commandline &raquo;</span>
    </a>
  </li>
              
            
            
            
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="../search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="col-md-12">
      
  <div class="section" id="derive-configs">
<h1>Derive configs<a class="headerlink" href="#derive-configs" title="Permalink to this headline">¶</a></h1>
<p>bake supports deriving configs, which allows you to put repetetive settings in a base config.</p>
<div class="section" id="deriving-a-config">
<h2>Deriving a config<a class="headerlink" href="#deriving-a-config" title="Permalink to this headline">¶</a></h2>
<p>Derving a config in bake is pretty straight forward, and looks like this:</p>
<div class="highlight-text"><div class="highlight"><pre>ExecutableConfig A
LibraryConfig    B, extends: A
CustomConfig     C, extends: B
ExecutableConfig D, extends: C
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The config type of the parent config does not matter, but only settings which are valid in BOTH configs will be inherited.
In the example above D gets the dependencies from A, because &#8220;Dependency&#8221; is valid in all configs, but D does not get
the &#8220;Files&#8221; from A, because &#8220;Files&#8221; is not valid in CustomConfig.</p>
</div>
</div>
<div class="section" id="inheritance-implications">
<h2>Inheritance implications<a class="headerlink" href="#inheritance-implications" title="Permalink to this headline">¶</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="41%" />
<col width="59%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Setting</th>
<th class="head">Derived</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>Set</td>
<td>parent + child</td>
</tr>
<tr class="row-odd"><td>Dependency</td>
<td>parent + child</td>
</tr>
<tr class="row-even"><td>ExternalLibrary</td>
<td>parent + child
(ordered by line number)</td>
</tr>
<tr class="row-odd"><td>ExternalLibrarySearchPath</td>
<td>parent + child
(ordered by line number)</td>
</tr>
<tr class="row-even"><td>UserLibrary</td>
<td>parent + child
(ordered by line number)</td>
</tr>
<tr class="row-odd"><td>PreSteps</td>
<td>parent + child</td>
</tr>
<tr class="row-even"><td>PostSteps</td>
<td>parent + child</td>
</tr>
<tr class="row-odd"><td>Makefile</td>
<td>used from parent if not
in child</td>
</tr>
<tr class="row-even"><td>CommandLine</td>
<td>used from parent if not
in child</td>
</tr>
<tr class="row-odd"><td>Files</td>
<td>parent + child</td>
</tr>
<tr class="row-even"><td>ExcludeFiles</td>
<td>parent + child</td>
</tr>
<tr class="row-odd"><td>IncludeDir</td>
<td>parent + child</td>
</tr>
<tr class="row-even"><td>LinkerScript</td>
<td>used from parent if not in child</td>
</tr>
<tr class="row-odd"><td>ArtifactName</td>
<td>used from parent if not in child</td>
</tr>
<tr class="row-even"><td>MapFile</td>
<td>used from parent if not in child</td>
</tr>
</tbody>
</table>
<table border="1" class="docutils">
<colgroup>
<col width="41%" />
<col width="59%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Toolchain Setting</th>
<th class="head">Derived</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>basedOn</td>
<td>used from parent if not in child</td>
</tr>
<tr class="row-odd"><td>outputDir</td>
<td>used from parent if not in child</td>
</tr>
<tr class="row-even"><td>command</td>
<td>used from parent if not in child</td>
</tr>
<tr class="row-odd"><td>LibPrefixFlags</td>
<td>parent + child</td>
</tr>
<tr class="row-even"><td>LibPostfixFlags</td>
<td>parent + child</td>
</tr>
<tr class="row-odd"><td>Flags</td>
<td>parent + child</td>
</tr>
<tr class="row-even"><td>Define</td>
<td>parent + child</td>
</tr>
<tr class="row-odd"><td>InternalDefines</td>
<td>used from parent if not in child</td>
</tr>
<tr class="row-even"><td>InternalIncludes</td>
<td>used from parent if not in child</td>
</tr>
<tr class="row-odd"><td>LintPolicy</td>
<td>parent + child</td>
</tr>
<tr class="row-even"><td>Docu</td>
<td>used from parent if not in child</td>
</tr>
</tbody>
</table>
</div>
</div>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
    </p>
    <p>
        &copy; Copyright 2015, E.S.R.Labs AG.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.<br/>
    </p>
  </div>
</footer>
  </body>
</html>