From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Have one GPR file build another with external variables Date: Sat, 30 May 2020 19:17:10 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: 2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:58890 Date: 2020-05-30T19:17:10+02:00 List-Id: 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. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de