I'm relatively new to Ant, but am having a great time exploring CPPTASKS. It will be very useful for our dept project.
My question centers around defining global some global flags for the compiler. Can anyone provide an example of this?
For instance, I want to use g++ and always have -Wall and -Wno-ununsed-parameter.
I'm assuming there's a way I can do this with refid??, but not certain.
Something like...
<cc debug="true" outfile="${bin}/math" outtype="static"> ... <compiler refid="[inserts the g++ for name and the compiler args]" /> ... </cc>
Any help appreciated.
-Allen
Not sure what exactly you are asking here. If you just want global compiler arguments then use a `compilerarg` tag as a direct child of the `cc` tag.
Is this what you need?
~Caleb
Do something like:
<project> <!-- define a compiler that can be ref'd or extended --> <compiler id="gcc-default" name="gcc"> <compilerarg value="-foo"/> </compiler>
<target...> <cc ...> <!-- if you just want to use the default --> <compiler refid="gcc-default"/> </cc> <cc ...> <compiler extends="gcc-default"> <compilerarg...>
See samples/xerces.ant for some examples of using extends.
Log in to post a comment.
I'm relatively new to Ant, but am having a great time exploring CPPTASKS. It will be very useful for our dept project.
My question centers around defining global some global flags for the compiler. Can anyone provide an example of this?
For instance, I want to use g++ and always have -Wall and -Wno-ununsed-parameter.
I'm assuming there's a way I can do this with refid??, but not certain.
Something like...
<cc debug="true" outfile="${bin}/math" outtype="static">
...
<compiler refid="[inserts the g++ for name and the compiler args]" />
...
</cc>
Any help appreciated.
-Allen
Not sure what exactly you are asking here. If you just want global compiler arguments then use a `compilerarg` tag as a direct child of the `cc` tag.
Is this what you need?
~Caleb
Do something like:
<project>
<!-- define a compiler that can be ref'd or extended -->
<compiler id="gcc-default" name="gcc">
<compilerarg value="-foo"/>
</compiler>
<target...>
<cc ...>
<!-- if you just want to use the default -->
<compiler refid="gcc-default"/>
</cc>
<cc ...>
<compiler extends="gcc-default">
<compilerarg...>
See samples/xerces.ant for some examples of using extends.