ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: Building C++ code using ANT
Date Tue, 15 May 2001 01:31:19 GMT
You know, these are definately ant-user-L issues, unless someone is
proposing a gcc and gnulink taskset. If someone did these I'm sure they'd be
welcome, not least to simplify JNI work.

I do some C++ builds under win32, but exec out to an nmake file generated
from the VC++ IDE. That may be viewed as cheating but it means that ant can
still control the whole build/deploy process;

-Steve

----- Original Message -----
From: "David Jencks" <davidjencks@earthlink.net>
To: <ant-dev@jakarta.apache.org>
Cc: <Vinay.Panwar@intertrade.com>
Sent: Monday, May 14, 2001 2:53 PM
Subject: Re: Building C++ code using ANT


> Hi,
> You didn't respond the last time I replied to this message, so I will be
> more specific.
>
> I can use ant to compile C++ files in linux using these two targets:
>
>   <target name="compile.cpp" depends="setup.cpp">
>     <apply executable="gcc" dest="${build.dir.cpp}" parallel="false">
>        <arg value="-w"/>
>        <!--arg value="-ggdb"/--><!--for debug-->
>        <arg value="-fhandle-exceptions"/>
>        <arg value="-DUSE_INETD"/>
>        <arg value="-DUNIX"/>
>        <!--arg value="-DDEBUG"/--><!--for debug-->
>        <arg value="-DARCH_32"/>
>        <arg value="-I/usr/interbase/include"/>
>        <arg value="-c"/>
>        <srcfile/>
>        <arg value="-o"/>
>        <targetfile/>
>        <fileset dir="${src.dir.cpp}" includes="*.cpp"
> excludes="Property.cpp, Window.cpp, interservice.cpp"/>
>        <mapper type="glob" from="*.cpp" to="*.o"/>
>     </apply>
>   </target>
> to compile cpp to o
>
> and
>
>     <target name="link.cpp" depends="compile.cpp">
>     <execon executable="gcc" parallel="true">
>        <srcfile/>
>        <arg value="-o"/>
>        <arg value="${build.dir.bin}/interserver"/>
>        <arg value="-lgds"/>
>        <arg value="-L/usr/local/lib"/>
>        <arg value="-lstdc++"/>
>        <arg value="-lc"/>
>        <arg value="-ldl"/>
>        <arg value="-lcrypt"/>
>        <fileset dir="${build.dir.cpp}" includes="*.o"/>
>     </execon>
>   </target>
>
> to link the results.
>
> I would like to know whether or not you can get something similar working
> in windows, and if you can, how.
>
> Thanks
> david jencks
>
> On 2001.05.14 15:30:12 -0400 "Panwar, Vinay" wrote:
> > Hi,
> >
> > My application has both java as well as C++ source files. I'm currently
> > using the build.xml to compile only the Java code. How do i extend this
> > build.xml to compile the C++ code(linking the .obj files to a .dll),
> > since
> > the C++ code is also a part of the application.
> >
> > Please let me know.
> >
> > Thanks
> > -Vinay Panwar
> > InterTrade Systems
> > 408 871 5775
> >
> >
>
>


Mime
View raw message