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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d13bf824aeeb7e2b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.129.133 with SMTP id nw5mr11399047pbb.3.1330348120466; Mon, 27 Feb 2012 05:08:40 -0800 (PST) Path: h9ni15209pbe.0!nntp.google.com!news1.google.com!postnews.google.com!w19g2000vbe.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Question about GNAT project files. Date: Mon, 27 Feb 2012 05:08:40 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 X-Trace: posting.google.com 1330348120 7671 127.0.0.1 (27 Feb 2012 13:08:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 27 Feb 2012 13:08:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w19g2000vbe.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20111222 Firefox/9.0.1,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-02-27T05:08:40-08:00 List-Id: Peter C. Chapin wrote on comp.lang.ada: > I have a library described by a project file, say lib.gpr. I also have a > test program that exercises the library described by a different project > file tests.gpr. Finally I have a benchmark program that does speed tests > of the library described by a project file benchmarks.gpr. > > This is fine but it's a pain having three separate projects. Typically > if I change the library I also want to update the tests and benchmarks. > I'd like to do all that from a single instance of GPS. [...] > What is the "right" way to do this? I would keep the library project file unchanged and create one project file for both the tests and the benchmark: with "lib.gpr"; project Main is for Source_Dirs use ("tests", "benchmarks"); for Main use ("test", "benchmark"); end Main; You load main.gpr in GPS. If a source file of the library has changed, gnatmake will recursively rebuild the library using the compiler switches specified in lib.gpr and will rebuild any source files of the tests or benchmark that depend on the recompiled units in the library. Make sure the Object_Dir of your two project files are different. Make sure that lib.gpr contains "for Externally_Built use "false";" (this is the default if you don't specify anything). HTH -- Ludovic Brenta.