summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMark Donszelmann <Mark.Donszelmann@gmail.com>2010-01-11 12:08:12 +0100
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2010-01-11 12:08:12 +0100
commitb5f0851c67e8212bddb2cc19d614d648a9f629be (patch)
tree89cb8f439686bee27917de78d6b9c50204c754a6 /src/main
parent31a2863c1a9a5e8960c6a61a0b26e6c1a3d3b0f7 (diff)
downloadcpptasks-parallel-b5f0851c67e8212bddb2cc19d614d648a9f629be.tar.gz
cpptasks-parallel-b5f0851c67e8212bddb2cc19d614d648a9f629be.tar.bz2
cpptasks-parallel-b5f0851c67e8212bddb2cc19d614d648a9f629be.tar.xz
cpptasks-parallel-b5f0851c67e8212bddb2cc19d614d648a9f629be.zip
Limit length on windows absolute output file
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java
index 92d06ea..b0c9a95 100644
--- a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java
+++ b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java
@@ -33,7 +33,6 @@ import net.sf.antcontrib.cpptasks.TargetDef;
import net.sf.antcontrib.cpptasks.VersionInfo;
import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.types.Environment;
@@ -54,6 +53,9 @@ public abstract class CommandLineLinker extends AbstractLinker
private CommandLineLinker libtoolLinker;
private boolean newEnvironment = false;
private String outputSuffix;
+
+ // FREEHEP
+ private int maxPathLength = 250;
/** Creates a comand line linker invocation */
@@ -224,6 +226,11 @@ public abstract class CommandLineLinker extends AbstractLinker
}
protected String[] getOutputFileSwitch(CCTask task, String outputFile) {
+ // FREEHEP BEGIN
+ if (isWindows() && outputFile.length() > maxPathLength) {
+ throw new BuildException("Absolute path too long, "+outputFile.length()+" > "+maxPathLength+": '"+outputFile);
+ }
+ // FREEHEP END
return getOutputFileSwitch(outputFile);
}
protected abstract String[] getOutputFileSwitch(String outputFile);
@@ -337,7 +344,6 @@ public abstract class CommandLineLinker extends AbstractLinker
protected String prepareFilename(StringBuffer buf,
String outputDir, String sourceFile) {
// FREEHEP BEGIN exit if absolute path is too long. Max length on relative paths in windows is even shorter.
- int maxPathLength = 250;
if (isWindows() && sourceFile.length() > maxPathLength) {
throw new BuildException("Absolute path too long, "+sourceFile.length()+" > "+maxPathLength+": '"+sourceFile);
}