cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cons and different environments


From: rick . croote
Subject: Re: cons and different environments
Date: Tue, 22 Feb 2005 11:19:48 -0800


There are two ways to handle this, and Daniel has pointed out one approach to one of the solutions.  First decide whether or not the shared code is a variant, in that it is common code that MUST have different compile options.  If this is not a variant code situation, then Daniel has the right idea, although it would always be better, for maintainability, to manage common code by building a static library and then linking the library in all places required.  If however this is variant code, then you must allow cons to put the output somewhere else, so that means you have at least one more separate target directory for ErrorHanlder.o to go to, and at that point cons will see that each target has a unique and separate set of build rules.

---
Rick Croote
Software Engineer
Environment and Tools Team
Philips Medical Systems
Bothell, WA
address@hidden
Phone: 425-487-7834








<address@hidden>

Sent by:
address@hidden

02/22/2005 09:02 AM

       
        To:        <address@hidden>
        cc:        (bcc: Rick Croote/ATL-BTL/MS/PHILIPS)
        Subject:        Re: cons and different environments

        Classification:        





Daniel Graupner <address@hidden> schrieb am 22.02.2005,
17:48:19:
> Program $CONS 'Scheduler', 'Scheduler.cpp','../classes/Scheduler.cpp','../classe
> s/SchedulerEvent.cpp','../classes/ErrorHandler.cpp';
> Program $CONS 'Configuration', 'Configuration.cpp', '../classes/Configuration.cp
> p', '../classes/ErrorHandler.cpp';
>
>
> Scheduler builds fine, to build Configuration I need the Compiler-Switch '-lxerces-c'. I tried to
> clone the $CONS Environment in $CONS2 with LIBS=>'-lxerces-c' .
> But no cons exits with the error that there are two ways to build '../classes/ErrorHandler.cpp'. OK,
> I know why this error appears, but I have no idea how to deal with it!


Hmm, is it common to define a 2nd environment and write:
Program $CONS 'Configuration', 'Configuration.cpp',
'../classes/Configuration.cpp', '../classes/ErrorHandler.o';

This seem to work.

Regards, Daniel.


_______________________________________________
address@hidden
http://lists.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]