An abstract Compiler implementation which uses an external program to
perform the compile.
CommandLineCompiler
protected CommandLineCompiler(String command,
String identifierArg,
String[] sourceExtensions,
String[] headerExtensions,
String outputSuffix,
boolean libtool,
CommandLineCompiler libtoolCompiler,
boolean newEnvironment,
Environment env)
addImpliedArgs
protected abstract void addImpliedArgs(Vector args,
boolean debug,
boolean multithreaded,
boolean exceptions,
LinkType linkType,
Boolean rtti,
OptimizationEnum optimization)
addIncludes
protected void addIncludes(String baseDirPath,
File[] includeDirs,
Vector args,
Vector relativeArgs,
StringBuffer includePathId)
Adds command-line arguments for include directories.
If relativeArgs is not null will add corresponding relative paths
include switches to that vector (for use in building a configuration
identifier that is consistent between machines).
includeDirs
- Array of include directory pathsargs
- Vector of command line arguments used to execute the taskrelativeArgs
- Vector of command line arguments used to build the
configuration identifier
addWarningSwitch
protected abstract void addWarningSwitch(Vector args,
int warnings)
buildDefineArguments
protected void buildDefineArguments(CompilerDef[] defs,
Vector args)
getArgumentCountPerInputFile
protected int getArgumentCountPerInputFile()
getCommand
protected final String getCommand()
getDefineSwitch
protected abstract void getDefineSwitch(StringBuffer buffer,
String define,
String value)
getEnvironmentIncludePath
protected abstract File[] getEnvironmentIncludePath()
getIdentifier
public String getIdentifier()
Retrieve an identifier that identifies the specific version of the
compiler. Compilers with the same identifier should produce the same
output files for the same input files and command line switches.
- getIdentifier in interface Processor
- getIdentifier in interface AbstractProcessor
getIncludeDirSwitch
protected abstract String getIncludeDirSwitch(String source)
getInputFileArgument
protected String getInputFileArgument(File outputDir,
String filename,
int index)
getLibtool
protected final boolean getLibtool()
getLibtoolCompiler
public final CommandLineCompiler getLibtoolCompiler()
Obtains the same compiler, but with libtool set
Default behavior is to ignore libtool
getMaximumCommandLength
public abstract int getMaximumCommandLength()
getMaximumInputFilesPerCommand
protected int getMaximumInputFilesPerCommand()
getTotalArgumentLengthForInputFile
protected int getTotalArgumentLengthForInputFile(File outputDir,
String inputFile)
getUndefineSwitch
protected abstract void getUndefineSwitch(StringBuffer buffer,
String define)
runCommand
protected int runCommand(CCTask task,
File workingDir,
String[] cmdline)
throws BuildException
This method is exposed so test classes can overload and test the
arguments without actually spawning the compiler
setCommand
protected final void setCommand(String command)