ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: <cc> (was Re: Java Development with Ant)
Date Thu, 30 May 2002 19:51:18 GMT

----- Original Message -----
From: "Gordon Tyler" <gordon.tyler@sitraka.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Thursday, May 30, 2002 11:48 AM
Subject: Re: <cc> (was Re: Java Development with Ant)


>
> ----- Original Message -----
> From: "Steve Loughran" <steve_l@iseran.com>
>
> > > > I managed to use it to compile a JNI native library, with a single
> build
> > > > file going javac->javah->cc->junit. As a process for building
jni
> libs,
> > > this
> > > > is slick, better than spawmning MSDEV as I have done in the past.
That
> > > > works, but gives you the usual IDE portability grief.
> > >
> > > I would be very interested to hear how you did this since our builds
are
> > > spawning MSDEV or make depending on the platform.
> >
> > I run msdev like this:
>
> Actually, I was wanting to know how you accomplished it using <cc> instead
> of exec'ing msdev...

aah. well, I could say wait until we publish in august, but I think the
native code chapter will go up on the web sooner than that, we will have to
wait and see. Anyhow, here are the build file snippets

first define our tools
  <target name="declare-compilers" depends="init">
    <compiler id="studio" name="msvc">
      <compilerarg value="/G6"/>
      <compilerarg value="/W3"/>
      <compilerarg value="/Ze"/>
      <compilerarg value="/Zc:forScope"
        if="msvc.version.is.devenv"/>
      <defineset>
        <define name="_CRTDBG_MAP_ALLOC"
          if="build.debug.istrue"/>
      </defineset>
    </compiler>
    <compiler id="studio2" extends="studio">
      <compilerarg value="/Gm"/>
    </compiler>
    <linker id="nt4linker" name="msvc"
        base="168427520">
      <linkerarg value="/version:4.0" />
    </linker>
  </target>


then build

  <target name="cc-windows" depends="headers,declare-compilers"
      if="is-windows" >
    <cc debug="${build.debug}"
        link="shared"
        outfile="${dist.filename.nosuffix}"
        objdir="${obj.dir}"
        multithreaded="true"
        exceptions="true"
        >
        <compiler refid="studio2" />
        <fileset dir="src/cpp/windows"
          includes="*.cpp"/>
        <defineset refid="build.defines"/>
        <defineset refid="platform.defines"/>
        <includepath location="${generated.dir}" />
        <sysincludepath location="${env.JAVA_HOME}/include" />
        <sysincludepath location="${env.JAVA_HOME}/include/win32" />
        <linker refid="nt4linker" />
        <syslibset libs="kernel32,user32"/>
    </cc>
  </target>



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message