diff options
Diffstat (limited to 'src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java')
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java index a8b7691..46ec59a 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java @@ -73,9 +73,7 @@ public abstract class CommandLineCompiler extends AbstractCompiler { * include switches to that vector (for use in building a configuration * identifier that is consistent between machines). * - * @param baseDirPaths - * A vector containing the parts of the working directory, - * produced by CUtil.DecomposeFile. + * @param baseDirPath Base directory path. * @param includeDirs * Array of include directory paths * @param args @@ -131,7 +129,6 @@ public abstract class CommandLineCompiler extends AbstractCompiler { /** * Compiles a source file. * - * @author Curt Arnold */ public void compile(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, @@ -285,6 +282,32 @@ public abstract class CommandLineCompiler extends AbstractCompiler { // add all appropriate defines and undefines // buildDefineArguments(defaultProviders, args); + int warnings = specificDef.getWarnings(defaultProviders, 0); + addWarningSwitch(args, warnings); + Enumeration argEnum = cmdArgs.elements(); + int endCount = 0; + while (argEnum.hasMoreElements()) { + CommandLineArgument arg = (CommandLineArgument) argEnum + .nextElement(); + switch (arg.getLocation()) { + case 1 : + args.addElement(arg.getValue()); + break; + case 2 : + endCount++; + break; + } + } + String[] endArgs = new String[endCount]; + argEnum = cmdArgs.elements(); + int index = 0; + while (argEnum.hasMoreElements()) { + CommandLineArgument arg = (CommandLineArgument) argEnum + .nextElement(); + if (arg.getLocation() == 2) { + endArgs[index++] = arg.getValue(); + } + } // // Want to have distinct set of arguments with relative // path names for includes that are used to build @@ -327,37 +350,14 @@ public abstract class CommandLineCompiler extends AbstractCompiler { addIncludes(baseDirPath, sysIncPath, args, null, null); StringBuffer buf = new StringBuffer(getIdentifier()); for (int i = 0; i < relativeArgs.size(); i++) { + buf.append(' '); buf.append(relativeArgs.elementAt(i)); + } + for (int i = 0; i < endArgs.length; i++) { buf.append(' '); + buf.append(endArgs[i]); } - buf.setLength(buf.length() - 1); String configId = buf.toString(); - int warnings = specificDef.getWarnings(defaultProviders, 0); - addWarningSwitch(args, warnings); - Enumeration argEnum = cmdArgs.elements(); - int endCount = 0; - while (argEnum.hasMoreElements()) { - CommandLineArgument arg = (CommandLineArgument) argEnum - .nextElement(); - switch (arg.getLocation()) { - case 1 : - args.addElement(arg.getValue()); - break; - case 2 : - endCount++; - break; - } - } - String[] endArgs = new String[endCount]; - argEnum = cmdArgs.elements(); - int index = 0; - while (argEnum.hasMoreElements()) { - CommandLineArgument arg = (CommandLineArgument) argEnum - .nextElement(); - if (arg.getLocation() == 2) { - endArgs[index++] = arg.getValue(); - } - } String[] argArray = new String[args.size()]; args.copyInto(argArray); boolean rebuild = specificDef.getRebuild(baseDefs, 0); |