mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
bug 334194: [MS Toolchain] Allow use of toolchain with only VS2008 installed
Patch from Marc-Andre Laperle
This commit is contained in:
parent
03762755b8
commit
825a17640d
1 changed files with 28 additions and 16 deletions
|
@ -1,7 +1,9 @@
|
||||||
package org.eclipse.cdt.msw.build;
|
package org.eclipse.cdt.msw.build;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
@ -91,14 +93,16 @@ public class WinEnvironmentVariableSupplier
|
||||||
|
|
||||||
public static IPath[] getIncludePath() {
|
public static IPath[] getIncludePath() {
|
||||||
// Include paths
|
// Include paths
|
||||||
|
List<IPath> includePaths = new ArrayList<IPath>();
|
||||||
if (sdkDir != null) {
|
if (sdkDir != null) {
|
||||||
return new IPath[] {
|
includePaths.add(new Path(sdkDir.concat("Include")));
|
||||||
new Path(vcDir.concat("Include")),
|
includePaths.add(new Path(sdkDir.concat("Include\\gl")));
|
||||||
new Path(sdkDir.concat("Include")),
|
}
|
||||||
new Path(sdkDir.concat("Include\\gl"))
|
|
||||||
};
|
if (vcDir != null) {
|
||||||
} else
|
includePaths.add(new Path(vcDir.concat("Include")));
|
||||||
return new IPath[0];
|
}
|
||||||
|
return includePaths.toArray(new IPath[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addvar(IBuildEnvironmentVariable var) {
|
private static void addvar(IBuildEnvironmentVariable var) {
|
||||||
|
@ -112,11 +116,12 @@ public class WinEnvironmentVariableSupplier
|
||||||
|
|
||||||
// The SDK Location
|
// The SDK Location
|
||||||
sdkDir = getSDKDir();
|
sdkDir = getSDKDir();
|
||||||
if (sdkDir == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
vcDir = getVCDir();
|
vcDir = getVCDir();
|
||||||
|
|
||||||
|
if (sdkDir == null && vcDir == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// INCLUDE
|
// INCLUDE
|
||||||
StringBuffer buff = new StringBuffer();
|
StringBuffer buff = new StringBuffer();
|
||||||
IPath includePaths[] = getIncludePath();
|
IPath includePaths[] = getIncludePath();
|
||||||
|
@ -127,16 +132,23 @@ public class WinEnvironmentVariableSupplier
|
||||||
|
|
||||||
// LIB
|
// LIB
|
||||||
buff = new StringBuffer();
|
buff = new StringBuffer();
|
||||||
buff.append(vcDir).append("Lib;");
|
if (vcDir != null)
|
||||||
buff.append(sdkDir).append("Lib;");
|
buff.append(vcDir).append("Lib;");
|
||||||
|
if (sdkDir != null)
|
||||||
|
buff.append(sdkDir).append("Lib;");
|
||||||
|
|
||||||
addvar(new WindowsBuildEnvironmentVariable("LIB", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
|
addvar(new WindowsBuildEnvironmentVariable("LIB", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
|
||||||
|
|
||||||
// PATH
|
// PATH
|
||||||
buff = new StringBuffer();
|
buff = new StringBuffer();
|
||||||
buff.append(vcDir).append("Bin;");
|
if (vcDir != null) {
|
||||||
buff.append(vcDir).append("vcpackages;");
|
buff.append(vcDir).append("Bin;");
|
||||||
buff.append(vcDir).append("..\\Common7\\IDE;");
|
buff.append(vcDir).append("vcpackages;");
|
||||||
buff.append(sdkDir).append("Bin;");
|
buff.append(vcDir).append("..\\Common7\\IDE;");
|
||||||
|
}
|
||||||
|
if (sdkDir != null) {
|
||||||
|
buff.append(sdkDir).append("Bin;");
|
||||||
|
}
|
||||||
addvar(new WindowsBuildEnvironmentVariable("PATH", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
|
addvar(new WindowsBuildEnvironmentVariable("PATH", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue