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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,80155a886d197693 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Conditional Compilation in Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <5618a901-6b05-4a60-8362-7821261da50b@f19g2000yqo.googlegroups.com> <768c8117-d8af-4a04-b27e-2e74b69c1e8b@y17g2000yqn.googlegroups.com> <942d7aa6-a93b-45a3-b250-9398e2754af7@y17g2000yqn.googlegroups.com> Date: Mon, 29 Jun 2009 14:30:11 +0200 Message-ID: <3pau3xsfpxdu$.50285z8b2fu.dlg@40tude.net> NNTP-Posting-Date: 29 Jun 2009 14:26:58 CEST NNTP-Posting-Host: 6de20300.newsspool1.arcor-online.net X-Trace: DXC=h@HYZj?`S[Z\PS5Xo=M[RVic==]BZ:af^4Fo<]lROoRQ^YC2XCjHcbYb_Ia1THOdU[DNcfSJ;bb[UFCTGGVUmh?TLK[5LiR>kgRbC^g^d3?a?U X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6712 Date: 2009-06-29T14:26:58+02:00 List-Id: On Mon, 29 Jun 2009 05:01:35 -0700 (PDT), Chrono wrote: > Yes, I mean a GPS scenario. In my case it is a bit difficult to put > files in a different folder for each scenario, due to I need to lead > with a some thousands of files project. But surely not all of them are scenario dependent. > I used to have a solution with > included a prepost compilation, a script launched before the unit > compilation which turned up some part of the code to a commented one, > so in "real" compilation, that part would not be compilated. I have a > feeling that GPS has some way to do this without external scripts, a > more ellegant solution, maybe using some compilation directives. > My last implementation included some like this: with Machine_Dependent_Constants; > package body My_Package is > procedure Calculate_Data (My_Variable : out Some_Type) is > begin > --# if TARGET > MY_Variable = 1; My_Variable := Machine_Dependent_Constants.My_Package_Constant; > --# end If TARGET > > --# if HOST > MY_Variable = 2; > --# end If HOST > end Calculate_Data; > end My_Package; You make a subdirectory for each platform and put a corresponding implementation of Machine_Dependent_Constants.ads there. Then you go as Simon have suggested. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de