Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2007-11-12 08:24:53 -0500
committerDoug Schaefer2007-11-12 08:24:53 -0500
commitb9444b6017aa4db7a03d5b80ea5579560c806a53 (patch)
tree38255a0ce3f1e0aec423278f41c722c4e5562456 /windows/org.eclipse.cdt.msw.build
parenta37779e2bcb5c9c2ebc6fcf3b41bd7baad110f49 (diff)
downloadorg.eclipse.cdt-b9444b6017aa4db7a03d5b80ea5579560c806a53.tar.gz
org.eclipse.cdt-b9444b6017aa4db7a03d5b80ea5579560c806a53.tar.xz
org.eclipse.cdt-b9444b6017aa4db7a03d5b80ea5579560c806a53.zip
Fixed up the MSW build. Added support for VC 2008 Express which now comes with a functional SDK subset.
Diffstat (limited to 'windows/org.eclipse.cdt.msw.build')
-rw-r--r--windows/org.eclipse.cdt.msw.build/plugin.xml3
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java26
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java62
3 files changed, 66 insertions, 25 deletions
diff --git a/windows/org.eclipse.cdt.msw.build/plugin.xml b/windows/org.eclipse.cdt.msw.build/plugin.xml
index 3c63de507e..bb86d18c93 100644
--- a/windows/org.eclipse.cdt.msw.build/plugin.xml
+++ b/windows/org.eclipse.cdt.msw.build/plugin.xml
@@ -8,6 +8,7 @@
archList="all"
configurationEnvironmentSupplier="org.eclipse.cdt.msw.build.WinEnvironmentVariableSupplier"
id="org.eclipse.cdt.msvc.toolchain.base"
+ isAbstract="true"
name="%toolchain.name"
osList="win32"
targetTool="org.eclipse.cdt.msvc.link;org.eclipse.cdt.msvc.lib">
@@ -259,7 +260,7 @@
<inputType
dependencyContentType="org.eclipse.cdt.core.cxxHeader"
id="org.eclipse.cdt.msvc.cl.inputType"
- scannerConfigDiscoveryProfileId="org.eclipse.cdt.msvc.build.clScannerInfo"
+ scannerConfigDiscoveryProfileId="org.eclipse.cdt.msw.build.clScannerInfo"
sourceContentType="org.eclipse.cdt.core.cxxSource">
</inputType>
<outputType
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 f873465c22..baae87bd6a 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
@@ -6,7 +6,6 @@ import java.util.Map;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
-import org.eclipse.cdt.utils.WindowsRegistry;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -21,20 +20,19 @@ public class WinDiscoveredPathInfo implements IDiscoveredPathInfo {
private final Map<String, String> symbols = new HashMap<String, String>();
public WinDiscoveredPathInfo() {
- WindowsRegistry reg = WindowsRegistry.getRegistry();
-
// Include paths
- String sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0", "InstallationFolder");
- if (sdkDir == null)
- sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1", "InstallationFolder");
-
- paths = new IPath[] {
- new Path(sdkDir.concat("\\VC\\Include")),
- new Path(sdkDir.concat("\\VC\\Include\\Sys")),
- new Path(sdkDir.concat("\\Include")),
- new Path(sdkDir.concat("\\Include\\gl"))
- };
-
+ 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];
+
symbols.put("_M_IX86", "600");
symbols.put("_WIN32", "1");
symbols.put("_MSC_VER", "1400");
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 25ed330d7a..e759581b15 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
@@ -83,34 +83,76 @@ public class WinEnvironmentVariableSupplier
envvars.put(var.getName(), var);
}
- private void initvars() {
- envvars = new HashMap<String, IBuildEnvironmentVariable>();
+ public static String getSDKDir() {
+ WindowsRegistry reg = WindowsRegistry.getRegistry();
+
+ String[] keys = {
+ "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1",
+ "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0A",
+ "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0",
+ };
+
+ for (int i = 0; i < keys.length; ++i) {
+ String sdkDir = reg.getLocalMachineValue(keys[i], "InstallationFolder");
+ if (sdkDir != null)
+ return sdkDir;
+ }
+
+ return null;
+ }
+
+ public static String getVCDir() {
+ WindowsRegistry reg = WindowsRegistry.getRegistry();
+
+ String vcDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", "9.0");
+ if (vcDir != null)
+ return vcDir;
- StringBuffer buff;
+ // Try full SDK with compiler
+ String sdkDir = getSDKDir();
+ if (sdkDir != null)
+ return sdkDir.concat("VC\\");
+
+ return null;
+ }
+
+ public static String getVSDir() {
WindowsRegistry reg = WindowsRegistry.getRegistry();
+ return reg.getLocalMachineValue("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7", "9.0");
+ }
+
+ private void initvars() {
+ envvars = new HashMap<String, IBuildEnvironmentVariable>();
// The SDK Location
- String sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0", "InstallationFolder");
+ String sdkDir = getSDKDir();
if (sdkDir == null)
- sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1", "InstallationFolder");
+ return;
+
+ String vcDir = getVCDir();
// INCLUDE
- buff = new StringBuffer();
- buff.append(sdkDir).append("VC\\Include;");
- buff.append(sdkDir).append("VC\\Include\\Sys;");
+ StringBuffer buff = new StringBuffer();
+ buff.append(vcDir).append("Include;");
+ buff.append(vcDir).append("Include\\Sys;");
buff.append(sdkDir).append("Include;");
buff.append(sdkDir).append("Include\\gl;");
addvar(new WindowsBuildEnvironmentVariable("INCLUDE", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
// LIB
buff = new StringBuffer();
- buff.append(sdkDir).append("VC\\Lib;");
+ buff.append(vcDir).append("Lib;");
buff.append(sdkDir).append("Lib;");
addvar(new WindowsBuildEnvironmentVariable("LIB", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
// PATH
buff = new StringBuffer();
- buff.append(sdkDir).append("VC\\Bin;");
+
+ String vsDir = getVSDir();
+ if (vsDir != null)
+ buff.append(vsDir).append("Common7\\IDE;");
+
+ buff.append(vcDir).append("Bin;");
buff.append(sdkDir).append("Bin;");
addvar(new WindowsBuildEnvironmentVariable("PATH", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
}

Back to the top