terp - the ANT Tasks
v1.3.304

com.codemesh.terp.ant.compiler.cpp
Class CppCompilerOptionsImpl

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.types.DataType
          extended by com.codemesh.terp.ant.compiler.cpp.CppCompilerOptionsImpl
All Implemented Interfaces:
CppCompilerOptions, java.lang.Cloneable

public class CppCompilerOptionsImpl
extends org.apache.tools.ant.types.DataType
implements CppCompilerOptions

A standalone implementation of the C++ compiler options. This type allows you to create a reusable set of options and apply it to a C++ compiler invocation or to a set of source files in a C++ compiler invocation.


Field Summary
protected  CompilerOptionSet<CppCompiler> options
           
 
Fields inherited from class org.apache.tools.ant.types.DataType
checked, ref
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
CppCompilerOptionsImpl()
           
 
Method Summary
 BoundsCheckOption createBoundsCheck()
          Creates a BoundsChecker option.
 CompileOnlyOption createCompileOnly()
          Creates a compile-only option (/c or -c).
 DebugOption createDebug()
          Creates a debug option.
 DefineOption createDefine()
          Creates a preprocessor definition.
 ExceptionsOption createExceptions()
          Creates an option that can be used to en/disable exception support.
 IncludeOption createInclude()
          Creates an option that adds one or more directories to the preprocessor search path.
 LibpathOption createLibpath()
          Creates an option that adds one or more directories to the library search path.
 LibraryOption createLibrary()
          Creates an option that specifies one or more libraries to link with.
 ManifestOption createManifest()
          Not used yet.
 MultithreadedOption createMultithreaded()
          Creates an option that governs whether or not multithreading is enabled.
 OptimizeOption createOptimize()
          Creates an option that controls compiler optimizations.
 GenericOption createOption()
          Creates a generic option.
 QuietOption createQuiet()
          Creates an option that controls compiler verbosity.
 RelocatableOption createRelocatable()
          Creates an option that controls whether or not the generated modules are relocatable in memory.
 RttiOption createRtti()
          Creates an option that can be used to en/disable RTTI support.
 RunpathOption createRunpath()
          Creates an option that can be used to embed a runpath in a module.
 RuntimeOption createRuntime()
          Creates an option that specifies the type of C++ runtime library to use.
 UndefineOption createUndefine()
          Creates an option that undefines a preprocessor definition.
 WarningsOption createWarning()
          Creates an option that adjusts the warning level or specific warnings.
 java.lang.String getId()
          Returns the compiler options' identifier.
 CompilerOptionSet<CppCompiler> getOptions()
          Returns the options configured for this instance.
 void setId(java.lang.String id)
          Sets the options' identifier.
 
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toString
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

options

protected CompilerOptionSet<CppCompiler> options
Constructor Detail

CppCompilerOptionsImpl

public CppCompilerOptionsImpl()
Method Detail

setId

public void setId(java.lang.String id)
Sets the options' identifier.

Parameters:
id - the identifier.

getId

public java.lang.String getId()
Returns the compiler options' identifier.

Returns:
the options' identifier.

getOptions

public CompilerOptionSet<CppCompiler> getOptions()
Returns the options configured for this instance.

Specified by:
getOptions in interface CppCompilerOptions
Returns:
the options.

createBoundsCheck

public BoundsCheckOption createBoundsCheck()
Creates a BoundsChecker option. A BoundsChecker option is only useful for MSVC++ builds and instructs the compiler task to instrument the compiled code for use by BoundsChecker. Obviously, for this to work, BoundsChecker needs to be installed and locatable.

Specified by:
createBoundsCheck in interface CppCompilerOptions
Returns:
a newly created BoundscheckOption.

createCompileOnly

public CompileOnlyOption createCompileOnly()
Creates a compile-only option (/c or -c). You should only have one enabled instance of this type in your compiler task.

Specified by:
createCompileOnly in interface CppCompilerOptions
Returns:
a newly created CompileOnlyOption.

createDebug

public DebugOption createDebug()
Creates a debug option. The debug option allows you to specify whether you wish to include debug information in the build result or not.

You should only have one enabled instance of this type in your compiler task. The debug option interacts with a number of other options (for example the RuntimeOption).

Specified by:
createDebug in interface CppCompilerOptions
Returns:
a newly created DebugOption.

createDefine

public DefineOption createDefine()
Creates a preprocessor definition.

Specified by:
createDefine in interface CppCompilerOptions
Returns:
a newly created DefineOption.

createExceptions

public ExceptionsOption createExceptions()
Creates an option that can be used to en/disable exception support. Not all compilers support programmatic control of exception support, so take care with this option. Don't use it unless you're sure you know what you're doing.

Specified by:
createExceptions in interface CppCompilerOptions
Returns:
a newly created ExceptionsOption.

createInclude

public IncludeOption createInclude()
Creates an option that adds one or more directories to the preprocessor search path.

Specified by:
createInclude in interface CppCompilerOptions
Returns:
a newly created IncludeOption.

createLibpath

public LibpathOption createLibpath()
Creates an option that adds one or more directories to the library search path.

Specified by:
createLibpath in interface CppCompilerOptions
Returns:
a newly created LibpathOption.

createLibrary

public LibraryOption createLibrary()
Creates an option that specifies one or more libraries to link with. The option supports more than one library via a comma- or semicolon- separated list. Don't use directory names here. Don't use file extensions; they are automatically added.

Specified by:
createLibrary in interface CppCompilerOptions
Returns:
a newly created LibraryOption.

createManifest

public ManifestOption createManifest()
Not used yet.

Specified by:
createManifest in interface CppCompilerOptions
Returns:
a newly created ManifestOption.

createMultithreaded

public MultithreadedOption createMultithreaded()
Creates an option that governs whether or not multithreading is enabled. This is a simple boolean option that influences several other options, for example RuntimeOption. It can result in several different switches being added to the compiler invocation in multiple phases. Don't use more than one enabled option of this type.

Specified by:
createMultithreaded in interface CppCompilerOptions
Returns:
a newly created MultithreadedOption.

createOptimize

public OptimizeOption createOptimize()
Creates an option that controls compiler optimizations.

Specified by:
createOptimize in interface CppCompilerOptions
Returns:
a newly created OptimizeOption.

createOption

public GenericOption createOption()
Creates a generic option. A generic option does not have any smarts about its interaction with other options or with the compiler. You specify to which compiler it applies, you specify to which compiler phase it applies, you're in charge of resolving conflicts with other options. GenericOptions are teh escape hatch of the C++ compiler. They allow you to pass any compiler switch you want but you're completely on your own in managing them and figuring them out.

Specified by:
createOption in interface CppCompilerOptions
Returns:
a newly created GenericOption.

createQuiet

public QuietOption createQuiet()
Creates an option that controls compiler verbosity.

Specified by:
createQuiet in interface CppCompilerOptions
Returns:
a newly created QuietOption.

createRelocatable

public RelocatableOption createRelocatable()
Creates an option that controls whether or not the generated modules are relocatable in memory. For most Unix compilers, this is equivalent to the -KPIC or -fPIC option.

Specified by:
createRelocatable in interface CppCompilerOptions
Returns:
a newly created RelocatableOption.

createRtti

public RttiOption createRtti()
Creates an option that can be used to en/disable RTTI support. Not all compilers support programmatic control of RTTI support, so take care with this option. Don't use it unless you're sure you know what you're doing.

Specified by:
createRtti in interface CppCompilerOptions
Returns:
a newly created RttiOption.

createRunpath

public RunpathOption createRunpath()
Creates an option that can be used to embed a runpath in a module. This is only relevant on Unix/Linux platforms where a runtime searchpath can be used to modify the default searchpaths configured in the execution environment.

Specified by:
createRunpath in interface CppCompilerOptions
Returns:
a newly created RunpathOption.

createRuntime

public RuntimeOption createRuntime()
Creates an option that specifies the type of C++ runtime library to use. This is only relevant when using the Microsoft compiler.

Specified by:
createRuntime in interface CppCompilerOptions
Returns:
a newly created RuntimeOption.

createUndefine

public UndefineOption createUndefine()
Creates an option that undefines a preprocessor definition.

Specified by:
createUndefine in interface CppCompilerOptions
Returns:
a newly created UndefineOption.

createWarning

public WarningsOption createWarning()
Creates an option that adjusts the warning level or specific warnings.

Specified by:
createWarning in interface CppCompilerOptions
Returns:
a newly created WarningsOption.

terp - the ANT Tasks
v1.3.304

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.