comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Have one GPR file build another with external variables
Date: Sat, 30 May 2020 11:48:46 -0700 (PDT)
Date: 2020-05-30T11:48:46-07:00	[thread overview]
Message-ID: <906b9ee8-19be-4fd0-8ba7-f7af5823bd56@googlegroups.com> (raw)
In-Reply-To: <rau4ej$rj7$1@gioia.aioe.org>

On Saturday, May 30, 2020 at 1:17:11 PM UTC-4, Dmitry A. Kazakov wrote:
> On 30/05/2020 18:59, Jere wrote:
> > Say I have a custom runtime whose project file (GPR) takes in an
> > external variable to compile in either debug or release
> > (-xBUILD=release vs -xBUILD=debug for example).  If I have another
> > project that uses this runtime with the same external variable, is
> > there a way for me to tell the project file for this 2nd project to
> > also rebuild the runtime GPR and use the same external variable value?
> > I'm looking for a solution within the GPR file if possible.  I know
> > I can always just do a make file, but wanted to see if I have a more
> > cross platform alternative.
> 
> I don't quite understand your question, because as a rule, you design 
> the project files so that when you change a scenario variable that would 
> also change the object and library directories. Thus there would be no 
> need to rebuild anything unless you change to code. Something like:
> 
>     Object_Dir_Path := "obj/" & OS "/" & arch & "/" & BUILD;
>     for Object_Dir use Object_Dir_Path;
> 
> in the root GPR file. The project with-ing it can take Object_Dir_Path 
> for their Object_Dir:
> 
>     Object_Dir_Path := Parent.Object_Dir_Path;
> 
> This will make each project having its own set of object files along all 
> dependencies. If you want rather share object files across all projects 
> you can make the path absolute.
> 
I'm working with GNAT.  I've never seen a custom runtime be able to use
an obj subfolder.  I've only been able to get a runtime in GNAT to work
using adainclude for the source files and adalib for the object files.
I've not encountered an example where it allowed debug and release 
subfolders to the adalib folder.  Right now to build my project in debug
I do:
gprbuild my_runtime.gpr -xBUILD=debug
cd /somepath/my_library/
gprbuild my_library.gpr -xBUILD=debug

where my_library's runtime is set to my_runtime.  Conversely if I want
to build in release mode, I have to do:

gprbuild my_runtime.gpr -xBUILD=release
cd /somepath/my_library/
gprbuild my_library.gpr -xBUILD=release

I would like to see if there is someway for me to setup my_library.gpr
so that when do either 
gprbuild my_library.gpr -xBUILD=debug
OR
gprbuild my_library.gpr -xBUILD=release

it first recompiles my_runtime.gpr with the same external variable that
I used for my_library.gpr

I currently use a make file for it, but I would like to not require that
if possible since make isn't standard with all OS'es that support GNAT.

It may not be possible, just asking.

  reply	other threads:[~2020-05-30 18:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 16:59 Have one GPR file build another with external variables Jere
2020-05-30 17:17 ` Dmitry A. Kazakov
2020-05-30 18:48   ` Jere [this message]
2020-05-30 19:29     ` Dmitry A. Kazakov
2020-05-30 21:33     ` Simon Wright
2020-05-31 18:42       ` Jere
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox