Class CompilerDef
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
net.sf.antcontrib.cpptasks.ProcessorDef
net.sf.antcontrib.cpptasks.CompilerDef
- All Implemented Interfaces:
Cloneable
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 ProcessorDef
newEnvironmentFields inherited from class org.apache.tools.ant.types.DataType
checked, refFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a compiler command-line arg.voidAdds a compiler command-line arg.voidAdds a defineset.Creates an include path.Specifies precompilation prototype file and exclusions.Creates a system include path.voidexecute()String[]Returns the compiler-specific include path.getActivePrecompile(CompilerDef ccElement) String[]final booleangetExceptions(CompilerDef[] defaultProviders, int index) booleangetMultithreaded(CompilerDef[] defaultProviders, int index) final OptimizationEnumgetOptimization(CompilerDef[] defaultProviders, int index) Obtains the appropriate processor (compiler, linker)final BooleangetRtti(CompilerDef[] defaultProviders, int index) intgetWarnings(CompilerDef[] defaultProviders, int index) voidsetClassname(String classname) Sets the default compiler adapter.voidsetExceptions(boolean exceptions) Enables or disables exception support.voidsetMultithreaded(boolean multithreaded) Enables or disables generation of multithreaded code.voidsetName(CompilerEnum name) Sets compiler type.voidsetOptimize(OptimizationEnum value) Sets optimization level.protected voidsetProcessor(Processor proc) Sets the processorvoidsetRtti(boolean rtti) Enables or disables run-time type information.voidsetWarnings(WarningLevelEnum level) Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "aserror".Methods inherited from class ProcessorDef
addConfiguredProcessorArg, addConfiguredProcessorParam, addEnv, addFileset, booleanValueOf, createConfiguration, getActiveProcessorArgs, getActiveProcessorParams, getDebug, getDefaultProviders, getExtends, getInherit, getLibtool, getProcessor, getRebuild, hasFileSets, isActive, setDebug, setDescription, setExtends, setId, setIf, setInherit, setLibtool, setNewenvironment, setRebuild, setRefid, setUnless, visitFilesMethods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes, toStringMethods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setLocation, setProject
-
Constructor Details
-
CompilerDef
public CompilerDef()
-
-
Method Details
-
addConfiguredCompilerArg
Adds a compiler command-line arg. -
addConfiguredCompilerParam
Adds a compiler command-line arg. -
addConfiguredDefineset
Adds a defineset. -
createIncludePath
Creates an include path. -
createPrecompile
Specifies precompilation prototype file and exclusions.- Throws:
org.apache.tools.ant.BuildException
-
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- Throws:
org.apache.tools.ant.BuildException
-
getActiveDefines
-
getActiveIncludePaths
Returns the compiler-specific include path. -
getActivePrecompile
-
getActiveSysIncludePaths
-
getExceptions
-
getRtti
-
getOptimization
-
getMultithreaded
-
getProcessor
Description copied from class:ProcessorDefObtains the appropriate processor (compiler, linker)- Overrides:
getProcessorin classProcessorDef- Returns:
- processor
-
getWarnings
-
setClassname
Sets the default compiler adapter. Use the "name" attribute when the compiler is a supported compiler.- Overrides:
setClassnamein classProcessorDef- Parameters:
classname- fully qualified classname which implements CompilerAdapter- Throws:
org.apache.tools.ant.BuildException
-
setExceptions
public void setExceptions(boolean exceptions) Enables or disables exception support.- Parameters:
exceptions- if true, exceptions are supported.
-
setRtti
public void setRtti(boolean rtti) Enables or disables run-time type information.- Parameters:
rtti- if true, run-time type information is supported.
-
setMultithreaded
public void setMultithreaded(boolean multithreaded) Enables or disables generation of multithreaded code. Unless specified, multithreaded code generation is enabled.- Parameters:
multithreaded- If true, generated code may be multithreaded.
-
setName
Sets compiler type.Supported compilers
gcc (default) GCC C++ compiler g++ GCC C++ compiler c++ GCC C++ compiler g77 GNU Fortran compiler msvc Microsoft Visual C++ bcc Borland C++ Compiler msrc Microsoft Resource Compiler brc Borland Resource Compiler df Compaq Visual Fortran Compiler midl Microsoft MIDL Compiler icl Intel C++ compiler for Windows (IA-32) ecl Intel C++ compiler for Windows (IA-64) icc Intel C++ compiler for Linux (IA-32) ecc Intel C++ compiler for Linux (IA-64) CC Sun ONE C++ compiler aCC HP aC++ C++ Compiler os390 OS390 C Compiler os400 Icc Compiler sunc89 Sun C89 C Compiler xlC VisualAge C Compiler uic Qt user interface compiler moc Qt meta-object compiler wcl OpenWatcom C/C++ compiler wfl OpenWatcom FORTRAN compiler - Throws:
org.apache.tools.ant.BuildException
-
setProcessor
Description copied from class:ProcessorDefSets the processor- Overrides:
setProcessorin classProcessorDef- Parameters:
proc- processor, may not be null.- Throws:
org.apache.tools.ant.BuildException- if ProcessorDef is a reference
-
setWarnings
Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "aserror". -
setOptimize
Sets optimization level.- Parameters:
value- optimization level
-