1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>cpptasks: Compile tasks for Apache Ant - cc</title>
<style type="text/css" media="all">
@import url("../css/maven-base.css");
@import url("../css/maven-theme.css");
@import url("../css/site.css");
</style>
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body class="composite">
<div id="banner">
<a href="http://ant-contrib.sourceforge.net/" id="bannerLeft">
ant-contrib
</a>
<a href="http://www.sourceforge.net/" id="bannerRight">
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
Last Published: 2008-04-02
|
<a href="http://ant-contrib.sourceforge.net/" class="externalLink">ant-contrib</a>
>
<a href="../">cpptasks</a>
</div>
<div class="xright">
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Get cpptasks</h5>
<ul>
<li class="none">
<a href="http://sourceforge.net/project/showfiles.php?group_id=36177" class="externalLink">Download</a>
</li>
<li class="none">
<a href="../changes-report.html">Changes</a>
</li>
<li class="none">
<a href="../license.html">License</a>
</li>
</ul>
<h5>About cpptasks</h5>
<ul>
<li class="none">
<a href="../index.html">Usage</a>
</li>
</ul>
<h5>Elements</h5>
<ul>
<li class="none">
<strong>cc</strong>
</li>
<li class="none">
<a href="../antdocs/CompilerDef.html">compiler</a>
</li>
<li class="none">
<a href="../antdocs/DefineSet.html">defineset</a>
</li>
<li class="none">
<a href="../antdocs/DistributerDef.html">distributer</a>
</li>
<li class="none">
<a href="../antdocs/LibrarySet.html">libraryset</a>
</li>
<li class="none">
<a href="../antdocs/LinkerDef.html">linker</a>
</li>
<li class="none">
<a href="../antdocs/SystemLibrarySet.html">syslibraryset</a>
</li>
<li class="none">
<a href="../antdocs/TargetDef.html">targetplatform</a>
</li>
<li class="none">
<a href="../antdocs/VersionInfo.html">versioninfo</a>
</li>
</ul>
<h5>Community</h5>
<ul>
<li class="none">
<a href="../mail-lists.html">Mailing Lists</a>
</li>
<li class="none">
<a href="../issue-tracking.html">Issue Tracking</a>
</li>
<li class="none">
<a href="http://sourceforge.net/projects/ant-contrib/" class="externalLink">Project Page</a>
</li>
<li class="none">
<a href="http://sourceforge.net/news/?group_id=36177" class="externalLink">News</a>
</li>
</ul>
<h5>Development</h5>
<ul>
<li class="none">
<a href="../source-repository.html">Repository</a>
</li>
<li class="none">
<a href="../apidocs/index.html">JavaDoc</a>
</li>
<li class="none">
<a href="../integration.html">Continuous Integration</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section"><h2><a name="cc"></a>
cc</h2>
<div class="section"><h3><a name="Description"></a>
Description</h3>
Compile and link task.
<p>
This task can compile various source languages and produce executables,
shared libraries (aka DLL's) and static libraries. Compiler adaptors are
currently available for several C/C++ compilers, FORTRAN, MIDL and Windows
Resource files.
</p>
<p>
Copyright (c) 2001-2008, The Ant-Contrib project.
</p>
<p>
Licensed under the Apache Software License 2.0,
http://www.apache.org/licenses/LICENSE-2.0.
</p>
<p>
For use with Apache Ant 1.5 or later. This software is not a product of the
of the Apache Software Foundation and no endorsement is implied.
</p>
<p>
THIS SOFTWARE IS PROVIDED 'AS-IS', See
http://www.apache.org/licenses/LICENSE-2.0 for additional disclaimers.
</p>
To use:
<ol type="1"><li>
Place cpptasks.jar into Ant's classpath by placing it in Ant's lib
directory, adding it to the CLASSPATH environment variable or by using the
-lib command line option.
</li>
<li>
Add type and task definitions to the build file:
<ul><li>
Ant 1.6 or later:
<ul><li>Add xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks" to
<project> element.
</li>
<li>
Add <cpptasks:cc/>, <cpptasks:compiler/> and
<cpptasks:linker/> elements to the project.
</li>
</ul>
</li>
<li>
Ant 1.5 or later:
<ul><li>Add <taskdef resource="cpptasks.tasks"/> and
<typedef resource="cpptasks.types"/> to body of <project>
element.
</li>
<li>
Add <cc/>, <compiler/> and <linker/> elements to the
project.
</li>
</ul>
</li>
</ul>
</li>
<li>
Set the path and environment variables to be able to run compiler from
command line.
</li>
<li>
Build the project.
</li>
</ol>
</div>
<div class="section"><h3><a name="parameters"></a>
parameters</h3>
<table class="bodyTable"><tr class="a"><td><b>Attribute</b>
</td>
<td><b>Description</b>
</td>
<td><b>Type</b>
</td>
</tr>
<tr class="b"><td>classname</td>
<td>Sets the default compiler adapter. Use the "name" attribute when the
compiler is a supported compiler.</td>
<td>String</td>
</tr>
<tr class="a"><td>dataset</td>
<td>Sets the dataset for OS/390 builds.</td>
<td>String</td>
</tr>
<tr class="b"><td>debug</td>
<td>Enables or disables generation of debug info.</td>
<td>boolean</td>
</tr>
<tr class="a"><td>dependencydepth</td>
<td>Deprecated.
Controls the depth of the dependency evaluation. Used to do a quick
check of changes before a full build.
Any negative value which will perform full dependency checking. Positive
values will truncate dependency checking. A value of 0 will cause only
those files that changed to be recompiled, a value of 1 which cause
files that changed or that explicitly include a file that changed to be
recompiled.
Any non-negative value will cause a BuildException to be thrown before
attempting a link or completing the task.</td>
<td>int</td>
</tr>
<tr class="b"><td>description</td>
<td></td>
<td>String</td>
</tr>
<tr class="a"><td>exceptions</td>
<td>Enables generation of exception handling code</td>
<td>boolean</td>
</tr>
<tr class="b"><td>failonerror</td>
<td>Indicates whether the build will continue
even if there are compilation errors; defaults to true.</td>
<td>boolean</td>
</tr>
<tr class="a"><td>incremental</td>
<td>Enables or disables incremental linking.</td>
<td>boolean</td>
</tr>
<tr class="b"><td>libtool</td>
<td>Set use of libtool.
If set to true, the "libtool " will be prepended to the command line for
compatible processors</td>
<td>boolean</td>
</tr>
<tr class="a"><td>link</td>
<td>Sets the output file type. Supported values "executable", "shared", and
"static". Deprecated, specify outtype instead.</td>
<td><a href="../apidocs/net/sf/antcontrib/cpptasks/OutputTypeEnum.html">OutputTypeEnum</a>
</td>
</tr>
<tr class="b"><td>location</td>
<td></td>
<td>Location</td>
</tr>
<tr class="a"><td>multithreaded</td>
<td>Enables or disables generation of multithreaded code</td>
<td>boolean</td>
</tr>
<tr class="b"><td>name</td>
<td>Sets type of the default compiler and linker.
<table class="bodyTable"><thead>Supported compilers </thead><tr class="a"><td>gcc (default)</td>
<td>GCC C++ compiler</td>
</tr>
<tr class="b"><td>g++</td>
<td>GCC C++ compiler</td>
</tr>
<tr class="a"><td>c++</td>
<td>GCC C++ compiler</td>
</tr>
<tr class="b"><td>g77</td>
<td>GNU FORTRAN compiler</td>
</tr>
<tr class="a"><td>msvc</td>
<td>Microsoft Visual C++</td>
</tr>
<tr class="b"><td>bcc</td>
<td>Borland C++ Compiler</td>
</tr>
<tr class="a"><td>msrc</td>
<td>Microsoft Resource Compiler</td>
</tr>
<tr class="b"><td>brc</td>
<td>Borland Resource Compiler</td>
</tr>
<tr class="a"><td>df</td>
<td>Compaq Visual Fortran Compiler</td>
</tr>
<tr class="b"><td>midl</td>
<td>Microsoft MIDL Compiler</td>
</tr>
<tr class="a"><td>icl</td>
<td>Intel C++ compiler for Windows (IA-32)</td>
</tr>
<tr class="b"><td>ecl</td>
<td>Intel C++ compiler for Windows (IA-64)</td>
</tr>
<tr class="a"><td>icc</td>
<td>Intel C++ compiler for Linux (IA-32)</td>
</tr>
<tr class="b"><td>ecc</td>
<td>Intel C++ compiler for Linux (IA-64)</td>
</tr>
<tr class="a"><td>CC</td>
<td>Sun ONE C++ compiler</td>
</tr>
<tr class="b"><td>aCC</td>
<td>HP aC++ C++ Compiler</td>
</tr>
<tr class="a"><td>os390</td>
<td>OS390 C Compiler</td>
</tr>
<tr class="b"><td>os400</td>
<td>Icc Compiler</td>
</tr>
<tr class="a"><td>sunc89</td>
<td>Sun C89 C Compiler</td>
</tr>
<tr class="b"><td>xlC</td>
<td>VisualAge C Compiler</td>
</tr>
<tr class="a"><td>uic</td>
<td>Qt user interface compiler (creates .h, .cpp and moc_*.cpp files).</td>
</tr>
<tr class="b"><td>moc</td>
<td>Qt meta-object compiler</td>
</tr>
<tr class="a"><td>xpidl</td>
<td>Mozilla xpidl compiler (creates .h and .xpt files).</td>
</tr>
<tr class="b"><td>wcl</td>
<td>OpenWatcom C/C++ compiler</td>
</tr>
<tr class="a"><td>wfl</td>
<td>OpenWatcom FORTRAN compiler</td>
</tr>
</table>
</td>
<td><a href="../apidocs/net/sf/antcontrib/cpptasks/CompilerEnum.html">CompilerEnum</a>
</td>
</tr>
<tr class="b"><td>newenvironment</td>
<td>Do not propagate old environment when new environment variables are
specified.</td>
<td>boolean</td>
</tr>
<tr class="a"><td>objdir</td>
<td>Sets the destination directory for object files.
Generally this should be a property expression that evaluates to
distinct debug and release object file directories.</td>
<td>File</td>
</tr>
<tr class="b"><td>optimize</td>
<td>Sets optimization.</td>
<td><a href="../apidocs/net/sf/antcontrib/cpptasks/OptimizationEnum.html">OptimizationEnum</a>
</td>
</tr>
<tr class="a"><td>outfile</td>
<td>Sets the output file name. If not specified, the task will only compile
files and not attempt to link. If an extension is not specified, the
task may use a system appropriate extension and prefix, for example,
outfile="example" may result in "libexample.so" being created.</td>
<td>File</td>
</tr>
<tr class="b"><td>outputfileproperty</td>
<td>Specifies the name of a property to set with the physical filename that
is produced by the linker</td>
<td>String</td>
</tr>
<tr class="a"><td>outtype</td>
<td>Sets the output file type. Supported values "executable", "shared", and
"static".</td>
<td><a href="../apidocs/net/sf/antcontrib/cpptasks/OutputTypeEnum.html">OutputTypeEnum</a>
</td>
</tr>
<tr class="b"><td>owningtarget</td>
<td></td>
<td>Target</td>
</tr>
<tr class="a"><td>projectsonly</td>
<td></td>
<td>boolean</td>
</tr>
<tr class="b"><td>rebuild</td>
<td>If set to true, all files will be rebuilt.</td>
<td>boolean</td>
</tr>
<tr class="a"><td>relentless</td>
<td>If set to true, compilation errors will not stop the task until all
files have been attempted.</td>
<td>boolean</td>
</tr>
<tr class="b"><td>rtti</td>
<td>Enables run-time type information.</td>
<td>boolean</td>
</tr>
<tr class="a"><td>runtime</td>
<td>Sets the type of runtime library, possible values "dynamic", "static".</td>
<td><a href="../apidocs/net/sf/antcontrib/cpptasks/RuntimeType.html">RuntimeType</a>
</td>
</tr>
<tr class="b"><td>subsystem</td>
<td>Sets the nature of the subsystem under which that the program will
execute.
<table class="bodyTable"><thead>Supported subsystems </thead><tr class="a"><td>gui</td>
<td>Graphical User Interface</td>
</tr>
<tr class="b"><td>console</td>
<td>Command Line Console</td>
</tr>
<tr class="a"><td>other</td>
<td>Other</td>
</tr>
</table>
</td>
<td><a href="../apidocs/net/sf/antcontrib/cpptasks/SubsystemEnum.html">SubsystemEnum</a>
</td>
</tr>
<tr class="b"><td>taskname</td>
<td></td>
<td>String</td>
</tr>
<tr class="a"><td>tasktype</td>
<td></td>
<td>String</td>
</tr>
<tr class="b"><td>warnings</td>
<td>Enumerated attribute with the values "none", "severe", "default",
"production", "diagnostic", and "aserror".</td>
<td><a href="../apidocs/net/sf/antcontrib/cpptasks/WarningLevelEnum.html">WarningLevelEnum</a>
</td>
</tr>
</table>
</div>
<div class="section"><h3><a name="parameters_as_nested_elements"></a>
parameters as nested elements</h3>
<dl><dt><a href="CompilerDef.html">compiler</a>
</dt>
<dd>Adds a compiler definition or reference.</dd>
<dt><a href="CompilerArgument.html">compilerarg</a>
</dt>
<dd>Adds a compiler command-line arg. Argument will be inherited by all
nested compiler elements that do not have inherit="false".</dd>
<dt><a href="DefineSet.html">defineset</a>
</dt>
<dd>Adds a defineset. Will be inherited by all compiler elements that do not
have inherit="false".</dd>
<dt><a href="DistributerDef.html">distributer</a>
</dt>
<dd>Adds a distributer definition or reference (Non-functional prototype).</dd>
<dt><a href="#about:blank">env</a>
</dt>
<dd>Add an environment variable to the launched process.</dd>
<dt><a href="ConditionalFileSet.html">fileset</a>
</dt>
<dd>Adds a source file set.
Files in these filesets will be auctioned to the available compiler
configurations, with the default compiler implied by the cc element
bidding last. If no compiler is interested in the file, it will be
passed to the linker.
To have a file be processed by a particular compiler configuration, add
a fileset to the corresponding compiler element.</dd>
<dt><a href="IncludePath.html">includepath</a>
</dt>
<dd>Adds an include path.
Include paths will be inherited by nested compiler elements that do not
have inherit="false".</dd>
<dt><a href="LibrarySet.html">libset</a>
</dt>
<dd>Adds a library set.
Library sets will be inherited by all linker elements that do not have
inherit="false".</dd>
<dt><a href="LinkerDef.html">linker</a>
</dt>
<dd>Adds a linker definition. The first linker that is not disqualified by
its "if" and "unless" attributes will perform the link. If no child
linker element is active, the linker implied by the cc elements name or
classname attribute will be used.</dd>
<dt><a href="LinkerArgument.html">linkerarg</a>
</dt>
<dd>Adds a linker command-line arg. Argument will be inherited by all nested
linker elements that do not have inherit="false".</dd>
<dt><a href="PrecompileDef.html">precompile</a>
</dt>
<dd>Specifies precompilation prototype file and exclusions. Inherited by all
compilers that do not have inherit="false".</dd>
<dt><a href="ProjectDef.html">project</a>
</dt>
<dd>Specifies the generation of IDE project file. Experimental.</dd>
<dt><a href="SystemIncludePath.html">sysincludepath</a>
</dt>
<dd>Adds a system include path. Locations and timestamps of files located
using the system include paths are not used in dependency analysis.
Standard include locations should not be specified. The compiler
adapters should recognized the settings from the appropriate environment
variables or configuration files.
System include paths will be inherited by nested compiler elements that
do not have inherit="false".</dd>
<dt><a href="SystemLibrarySet.html">syslibset</a>
</dt>
<dd>Adds a system library set. Timestamps and locations of system library
sets are not used in dependency analysis.
Essential libraries (such as C Runtime libraries) should not be
specified since the task will attempt to identify the correct libraries
based on the multithread, debug and runtime attributes.
System library sets will be inherited by all linker elements that do not
have inherit="false".</dd>
<dt><a href="TargetDef.html">target</a>
</dt>
<dd>Adds a target definition or reference (Non-functional prototype).</dd>
<dt><a href="VersionInfo.html">versioninfo</a>
</dt>
<dd>Adds desriptive version information to be included in the
generated file. The first active version info block will
be used.</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">©
2001-2008
Ant-Contrib Project
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>
|