net.sf.antcontrib.cpptasks

Class CompilerDef


public final class CompilerDef
extends ProcessorDef

A compiler definition. compiler elements may be placed either as children of a cc element or the project element. A compiler element with an id attribute may be referenced from compiler elements with refid or extends attributes.
Author:
Adam Murdoch

Field Summary

Fields inherited from class net.sf.antcontrib.cpptasks.ProcessorDef

newEnvironment

Constructor Summary

CompilerDef()

Method Summary

void
addConfiguredCompilerArg(CompilerArgument arg)
Adds a compiler command-line arg.
void
addConfiguredCompilerParam(CompilerParam param)
Adds a compiler command-line arg.
void
addConfiguredDefineset(DefineSet defs)
Adds a defineset.
IncludePath
createIncludePath()
Creates an include path.
PrecompileDef
createPrecompile()
Specifies precompilation prototype file and exclusions.
SystemIncludePath
createSysIncludePath()
Creates a system include path.
void
execute()
UndefineArgument[]
getActiveDefines()
String[]
getActiveIncludePaths()
Returns the compiler-specific include path.
PrecompileDef
getActivePrecompile(CompilerDef ccElement)
String[]
getActiveSysIncludePaths()
boolean
getExceptions(CompilerDef[] defaultProviders, int index)
boolean
getMultithreaded(CompilerDef[] defaultProviders, int index)
OptimizationEnum
getOptimization(CompilerDef[] defaultProviders, int index)
Processor
getProcessor()
Boolean
getRtti(CompilerDef[] defaultProviders, int index)
int
getWarnings(CompilerDef[] defaultProviders, int index)
void
setClassname(String classname)
Sets the default compiler adapter.
void
setExceptions(boolean exceptions)
Enables or disables exception support.
void
setMultithreaded(boolean multithreaded)
Enables or disables generation of multithreaded code.
void
setName(CompilerEnum name)
Sets compiler type.
void
setOptimize(OptimizationEnum value)
Sets optimization level.
protected void
setProcessor(Processor proc)
void
setRtti(boolean rtti)
Enables or disables run-time type information.
void
setWarnings(WarningLevelEnum level)
Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "failtask".

Methods inherited from class net.sf.antcontrib.cpptasks.ProcessorDef

addConfiguredProcessorArg, addConfiguredProcessorParam, addEnv, addFileset, booleanValueOf, createConfiguration, getActiveProcessorArgs, getActiveProcessorParams, getDebug, getDefaultProviders, getExtends, getInherit, getLibtool, getProcessor, getRebuild, hasFileSets, isActive, setClassname, setDebug, setDescription, setExtends, setId, setIf, setInherit, setLibtool, setNewenvironment, setProcessor, setRebuild, setRefid, setUnless, visitFiles

Constructor Details

CompilerDef

public CompilerDef()

Method Details

addConfiguredCompilerArg

public void addConfiguredCompilerArg(CompilerArgument arg)
Adds a compiler command-line arg.

addConfiguredCompilerParam

public void addConfiguredCompilerParam(CompilerParam param)
Adds a compiler command-line arg.

addConfiguredDefineset

public void addConfiguredDefineset(DefineSet defs)
Adds a defineset.

createIncludePath

public IncludePath createIncludePath()
Creates an include path.

createPrecompile

public PrecompileDef createPrecompile()
            throws BuildException
Specifies precompilation prototype file and exclusions.

createSysIncludePath

public SystemIncludePath createSysIncludePath()
Creates 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.

execute

public void execute()
            throws org.apache.tools.ant.BuildException

getActiveDefines

public UndefineArgument[] getActiveDefines()

getActiveIncludePaths

public String[] getActiveIncludePaths()
Returns the compiler-specific include path.

getActivePrecompile

public PrecompileDef getActivePrecompile(CompilerDef ccElement)

getActiveSysIncludePaths

public String[] getActiveSysIncludePaths()

getExceptions

public final boolean getExceptions(CompilerDef[] defaultProviders,
                                   int index)

getMultithreaded

public boolean getMultithreaded(CompilerDef[] defaultProviders,
                                int index)

getOptimization

public final OptimizationEnum getOptimization(CompilerDef[] defaultProviders,
                                              int index)

getProcessor

public Processor getProcessor()
Overrides:
getProcessor in interface ProcessorDef

getRtti

public final Boolean getRtti(CompilerDef[] defaultProviders,
                             int index)

getWarnings

public int getWarnings(CompilerDef[] defaultProviders,
                       int index)

setClassname

public void setClassname(String classname)
            throws BuildException
Sets the default compiler adapter. Use the "name" attribute when the compiler is a supported compiler.
Overrides:
setClassname in interface ProcessorDef
Parameters:
classname - fully qualified classname which implements CompilerAdapter

setExceptions

public void setExceptions(boolean exceptions)
Enables or disables exception support.
Parameters:
exceptions - if true, exceptions are supported.

setMultithreaded

public void setMultithreaded(boolean multithreaded)
Enables or disables generation of multithreaded code. Unless specified, multithreaded code generation is enabled.
Parameters:

setName

public void setName(CompilerEnum name)
            throws BuildException
Sets compiler type.
gcc (default)GCC C++ compiler
g++GCC C++ compiler
c++GCC C++ compiler
g77GNU Fortran compiler
msvcMicrosoft Visual C++
bccBorland C++ Compiler
msrcMicrosoft Resource Compiler
brcBorland Resource Compiler
dfCompaq Visual Fortran Compiler
midlMicrosoft MIDL Compiler
iclIntel C++ compiler for Windows (IA-32)
eclIntel C++ compiler for Windows (IA-64)
iccIntel C++ compiler for Linux (IA-32)
eccIntel C++ compiler for Linux (IA-64)
CCSun ONE C++ compiler
aCCHP aC++ C++ Compiler
os390OS390 C Compiler
os400Icc Compiler
sunc89Sun C89 C Compiler
xlCVisualAge C Compiler
uicQt user interface compiler
mocQt meta-object compiler
wclOpenWatcom C/C++ compiler
wflOpenWatcom FORTRAN compiler

setOptimize

public void setOptimize(OptimizationEnum value)
Sets optimization level.
Parameters:
value - optimization level

setProcessor

protected void setProcessor(Processor proc)
            throws BuildException
Overrides:
setProcessor in interface ProcessorDef

setRtti

public void setRtti(boolean rtti)
Enables or disables run-time type information.
Parameters:
rtti - if true, run-time type information is supported.

setWarnings

public void setWarnings(WarningLevelEnum level)
Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "failtask".

Copyright B) 2001-2006 Ant-Contrib project. All Rights Reserved.