Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-01-12 23:21:41 -0500
committerAndrew Gvozdev2011-01-12 23:21:41 -0500
commit825a17640dca2b4f3bbe5d6bb0b8bf9acc4d96a7 (patch)
tree0fb1828f2cf945576a4fbb9bfd190a5e64ef4455 /windows
parent03762755b8f05773dfd00921c2315cd6d6ac8873 (diff)
downloadorg.eclipse.cdt-825a17640dca2b4f3bbe5d6bb0b8bf9acc4d96a7.tar.gz
org.eclipse.cdt-825a17640dca2b4f3bbe5d6bb0b8bf9acc4d96a7.tar.xz
org.eclipse.cdt-825a17640dca2b4f3bbe5d6bb0b8bf9acc4d96a7.zip
bug 334194: [MS Toolchain] Allow use of toolchain with only VS2008 installed
Patch from Marc-Andre Laperle
Diffstat (limited to 'windows')
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java44
1 files changed, 28 insertions, 16 deletions
diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java
index 83026e8b34..ff2316da8b 100644
--- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java
+++ b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java
@@ -1,7 +1,9 @@
package org.eclipse.cdt.msw.build;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -91,14 +93,16 @@ public class WinEnvironmentVariableSupplier
public static IPath[] getIncludePath() {
// Include paths
+ List<IPath> includePaths = new ArrayList<IPath>();
if (sdkDir != null) {
- return new IPath[] {
- new Path(vcDir.concat("Include")),
- new Path(sdkDir.concat("Include")),
- new Path(sdkDir.concat("Include\\gl"))
- };
- } else
- return new IPath[0];
+ includePaths.add(new Path(sdkDir.concat("Include")));
+ includePaths.add(new Path(sdkDir.concat("Include\\gl")));
+ }
+
+ if (vcDir != null) {
+ includePaths.add(new Path(vcDir.concat("Include")));
+ }
+ return includePaths.toArray(new IPath[0]);
}
private static void addvar(IBuildEnvironmentVariable var) {
@@ -112,11 +116,12 @@ public class WinEnvironmentVariableSupplier
// The SDK Location
sdkDir = getSDKDir();
- if (sdkDir == null)
- return;
-
vcDir = getVCDir();
+ if (sdkDir == null && vcDir == null) {
+ return;
+ }
+
// INCLUDE
StringBuffer buff = new StringBuffer();
IPath includePaths[] = getIncludePath();
@@ -127,16 +132,23 @@ public class WinEnvironmentVariableSupplier
// LIB
buff = new StringBuffer();
- buff.append(vcDir).append("Lib;");
- buff.append(sdkDir).append("Lib;");
+ if (vcDir != null)
+ buff.append(vcDir).append("Lib;");
+ if (sdkDir != null)
+ buff.append(sdkDir).append("Lib;");
+
addvar(new WindowsBuildEnvironmentVariable("LIB", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
// PATH
buff = new StringBuffer();
- buff.append(vcDir).append("Bin;");
- buff.append(vcDir).append("vcpackages;");
- buff.append(vcDir).append("..\\Common7\\IDE;");
- buff.append(sdkDir).append("Bin;");
+ if (vcDir != null) {
+ buff.append(vcDir).append("Bin;");
+ buff.append(vcDir).append("vcpackages;");
+ buff.append(vcDir).append("..\\Common7\\IDE;");
+ }
+ if (sdkDir != null) {
+ buff.append(sdkDir).append("Bin;");
+ }
addvar(new WindowsBuildEnvironmentVariable("PATH", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
}

Back to the top