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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a05:6214:2eb:: with SMTP id h11mr12310231qvu.94.1590864527351; Sat, 30 May 2020 11:48:47 -0700 (PDT) X-Received: by 2002:a05:6830:1dcb:: with SMTP id a11mr4058014otj.16.1590864527069; Sat, 30 May 2020 11:48:47 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!peer03.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 30 May 2020 11:48:46 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=70.109.61.125; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.125 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <906b9ee8-19be-4fd0-8ba7-f7af5823bd56@googlegroups.com> Subject: Re: Have one GPR file build another with external variables From: Jere Injection-Date: Sat, 30 May 2020 18:48:47 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 3858 X-Received-Body-CRC: 3314912542 Xref: reader01.eternal-september.org comp.lang.ada:58891 Date: 2020-05-30T11:48:46-07:00 List-Id: 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.