Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2010-07-15 15:26:06 -0400
committerDoug Schaefer2010-07-15 15:26:06 -0400
commit4f6745e045dc6168531a26c3921feed7fa8a9c5a (patch)
treeef82a145377e9864aa9deb5abe095d21f2828e68 /windows/org.eclipse.cdt.msw.build
parentf586166f3577dd090e88b4a22a334415ea9fa653 (diff)
downloadorg.eclipse.cdt-4f6745e045dc6168531a26c3921feed7fa8a9c5a.tar.gz
org.eclipse.cdt-4f6745e045dc6168531a26c3921feed7fa8a9c5a.tar.xz
org.eclipse.cdt-4f6745e045dc6168531a26c3921feed7fa8a9c5a.zip
Updated the Visual C++ build to support Windows 7 SDK.
Diffstat (limited to 'windows/org.eclipse.cdt.msw.build')
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java13
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java57
2 files changed, 37 insertions, 33 deletions
diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java
index baae87bd6a..58aa16100e 100644
--- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java
+++ b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java
@@ -8,7 +8,6 @@ import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscovere
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
/**
* @author Doug Schaefer
@@ -21,17 +20,7 @@ public class WinDiscoveredPathInfo implements IDiscoveredPathInfo {
public WinDiscoveredPathInfo() {
// Include paths
- String sdkDir = WinEnvironmentVariableSupplier.getSDKDir();
- if (sdkDir != null) {
- String vcDir = WinEnvironmentVariableSupplier.getVCDir();
- paths = new IPath[] {
- new Path(vcDir.concat("Include")),
- new Path(vcDir.concat("Include\\Sys")),
- new Path(sdkDir.concat("Include")),
- new Path(sdkDir.concat("Include\\gl"))
- };
- } else
- paths = new IPath[0];
+ paths = WinEnvironmentVariableSupplier.getIncludePath();
symbols.put("_M_IX86", "600");
symbols.put("_WIN32", "1");
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 b25bd8a364..83026e8b34 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
@@ -11,6 +11,8 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.cdt.managedbuilder.envvar.IProjectEnvironmentVariableSupplier;
import org.eclipse.cdt.utils.WindowsRegistry;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
/**
* @author DSchaefer
@@ -19,7 +21,9 @@ import org.eclipse.cdt.utils.WindowsRegistry;
public class WinEnvironmentVariableSupplier
implements IConfigurationEnvironmentVariableSupplier, IProjectEnvironmentVariableSupplier {
- private Map<String, IBuildEnvironmentVariable> envvars;
+ private static Map<String, IBuildEnvironmentVariable> envvars;
+ private static String sdkDir;
+ private static String vcDir;
private static class WindowsBuildEnvironmentVariable implements IBuildEnvironmentVariable {
@@ -51,63 +55,74 @@ public class WinEnvironmentVariableSupplier
}
+ public WinEnvironmentVariableSupplier() {
+ initvars();
+ }
+
public IBuildEnvironmentVariable getVariable(String variableName,
IManagedProject project, IEnvironmentVariableProvider provider) {
- if (envvars == null)
- initvars();
return envvars.get(variableName);
}
public IBuildEnvironmentVariable getVariable(String variableName,
IConfiguration configuration, IEnvironmentVariableProvider provider) {
- if (envvars == null)
- initvars();
return envvars.get(variableName);
}
public IBuildEnvironmentVariable[] getVariables(IManagedProject project,
IEnvironmentVariableProvider provider) {
- if (envvars == null)
- initvars();
return envvars.values().toArray(new IBuildEnvironmentVariable[envvars.size()]);
}
public IBuildEnvironmentVariable[] getVariables(
IConfiguration configuration, IEnvironmentVariableProvider provider) {
- if (envvars == null)
- initvars();
return envvars.values().toArray(new IBuildEnvironmentVariable[envvars.size()]);
}
- private void addvar(IBuildEnvironmentVariable var) {
- envvars.put(var.getName(), var);
- }
-
- public static String getSDKDir() {
+ private static String getSDKDir() {
WindowsRegistry reg = WindowsRegistry.getRegistry();
return reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.0", "InstallationFolder");
}
- public static String getVCDir() {
+ private static String getVCDir() {
WindowsRegistry reg = WindowsRegistry.getRegistry();
return reg.getLocalMachineValue("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", "9.0");
}
- private void initvars() {
+ public static IPath[] getIncludePath() {
+ // Include paths
+ 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];
+ }
+
+ private static void addvar(IBuildEnvironmentVariable var) {
+ envvars.put(var.getName(), var);
+ }
+
+ private static synchronized void initvars() {
+ if (envvars != null)
+ return;
envvars = new HashMap<String, IBuildEnvironmentVariable>();
// The SDK Location
- String sdkDir = getSDKDir();
+ sdkDir = getSDKDir();
if (sdkDir == null)
return;
- String vcDir = getVCDir();
+ vcDir = getVCDir();
// INCLUDE
StringBuffer buff = new StringBuffer();
- buff.append(vcDir).append("Include;");
- buff.append(sdkDir).append("Include;");
- buff.append(sdkDir).append("Include\\gl;");
+ IPath includePaths[] = getIncludePath();
+ for (IPath path : includePaths) {
+ buff.append(path.toOSString()).append(';');
+ }
addvar(new WindowsBuildEnvironmentVariable("INCLUDE", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
// LIB

Back to the top