logo       

RE: Precompiled Headers: msg#00116

programming.swig

Subject: RE: Precompiled Headers

One hack you could do is create a swig.swg file with this:

%insert("runtime") %{
#include "precompiled.h"
%}
%include "path/to/swig.swg"

This works because the current directory is first in the list of directories to
look at. The full list can be seen by running swig -v, so you can put this new
swig.swg in anyone of those that occur before the Lib directory where the real
swig.swg file is.

Incidentally, SWIG will display the path to this directory by using swig
-swiglib. So you could generate the new swig.swg file by using the output of
this command.

William

>-----Original Message-----
>From: swig-admin@xxxxxxxxxxxxxxx [mailto:swig-admin@xxxxxxxxxxxxxxx]On
>Behalf Of Brian Matt
>Sent: 16 September 2004 15:22
>To: Swig@xxxxxxxxxxxxxxx
>Subject: Re: [SWIG] Precompiled Headers
>
>
>Unfortunately none of the code insertion blocks will insert code at
>the top of the wrapper file. If there is no SWIG mechanism for this I
>can always create a wrapper file for the wrapper file and include all
>project specific includes in it. For example:
>
>#include "precompiled.h"
>
>//Include the SWIG generated wrapper
>#include "foo_wrap.cxx"
>
>I am trying to avoid this so if anyone has any other
>suggestions I am all ears.
>
>Thanks,
>BSMatt
>
>
>On Thu, 16 Sep 2004 10:04:14 -0400 (EDT), Josh Cherry
><jcherry@xxxxxxxxxxxxxxxx> wrote:
>>
>>
>>
>> On Thu, 16 Sep 2004, Brian Matt wrote:
>>
>> > I am including multiple wrapper files generated by SWIG
>into a project
>> > that uses precompiled headers. Unfortunately I can't
>figure out how to
>> > insert the #include "precompiled.h" line are the beginning of the
>> > generated wrapper file. When I place it in the .i file in a %{ %}
>> > section it places the line below a bunch of code which
>won't compile
>> > correctly. Is there a way to force code at the beginning of the
>> > wrapper file?
>>
>> As discussed at
>http://www.swig.org/Doc1.3/SWIG.html#SWIG_nn40, code can
>> be inserted in various places. Perhaps %runtime will put it
>early enough
>> for your purposes.
>>
>> Josh
>>
>> --
>> Joshua L. Cherry, Ph.D.
>> NCBI/NLM/NIH (Contractor)
>> jcherry@xxxxxxxxxxxxxxxx
>> _______________________________________________
>> Swig maillist - Swig@xxxxxxxxxxxxxxx
>> http://mailman.cs.uchicago.edu/mailman/listinfo/swig
>>
>_______________________________________________
>Swig maillist - Swig@xxxxxxxxxxxxxxx
>http://mailman.cs.uchicago.edu/mailman/listinfo/swig
>

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise