www.delorie.com/gnu/docs/gcc/gnat_ug_133.html   search  
 
Buy the book!


Untitled Document

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.9 Variables from Imported Projects

An attribute or variable defined in an imported or parent project can be used in expressions in the importing / extending project. Such an attribute or variable is prefixed with the name of the project and (if relevant) the name of package where it is defined.

 
  with "imported";
  project Main extends "base" is
     Var1 := Imported.Var;
     Var2 := Base.Var & ".new";

     package Builder is
        for Default_Switches ("Ada") use Imported.Builder.Ada_Switches &
                         "-gnatg" & "-v";
     end Builder;

     package Compiler is
        for Default_Switches ("Ada") use Base.Compiler.Ada_Switches;
     end Compiler;
  end Main;

In this example:


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003