mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Fixed up the MSW build. Added support for VC 2008 Express which now comes with a functional SDK subset.
This commit is contained in:
parent
a37779e2bc
commit
b9444b6017
3 changed files with 66 additions and 25 deletions
|
@ -8,6 +8,7 @@
|
||||||
archList="all"
|
archList="all"
|
||||||
configurationEnvironmentSupplier="org.eclipse.cdt.msw.build.WinEnvironmentVariableSupplier"
|
configurationEnvironmentSupplier="org.eclipse.cdt.msw.build.WinEnvironmentVariableSupplier"
|
||||||
id="org.eclipse.cdt.msvc.toolchain.base"
|
id="org.eclipse.cdt.msvc.toolchain.base"
|
||||||
|
isAbstract="true"
|
||||||
name="%toolchain.name"
|
name="%toolchain.name"
|
||||||
osList="win32"
|
osList="win32"
|
||||||
targetTool="org.eclipse.cdt.msvc.link;org.eclipse.cdt.msvc.lib">
|
targetTool="org.eclipse.cdt.msvc.link;org.eclipse.cdt.msvc.lib">
|
||||||
|
@ -259,7 +260,7 @@
|
||||||
<inputType
|
<inputType
|
||||||
dependencyContentType="org.eclipse.cdt.core.cxxHeader"
|
dependencyContentType="org.eclipse.cdt.core.cxxHeader"
|
||||||
id="org.eclipse.cdt.msvc.cl.inputType"
|
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">
|
sourceContentType="org.eclipse.cdt.core.cxxSource">
|
||||||
</inputType>
|
</inputType>
|
||||||
<outputType
|
<outputType
|
||||||
|
|
|
@ -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.IDiscoveredPathInfo;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
|
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.resources.IProject;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
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>();
|
private final Map<String, String> symbols = new HashMap<String, String>();
|
||||||
|
|
||||||
public WinDiscoveredPathInfo() {
|
public WinDiscoveredPathInfo() {
|
||||||
WindowsRegistry reg = WindowsRegistry.getRegistry();
|
|
||||||
|
|
||||||
// Include paths
|
// Include paths
|
||||||
String sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0", "InstallationFolder");
|
String sdkDir = WinEnvironmentVariableSupplier.getSDKDir();
|
||||||
if (sdkDir == null)
|
if (sdkDir != null) {
|
||||||
sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1", "InstallationFolder");
|
String vcDir = WinEnvironmentVariableSupplier.getVCDir();
|
||||||
|
paths = new IPath[] {
|
||||||
paths = new IPath[] {
|
new Path(vcDir.concat("Include")),
|
||||||
new Path(sdkDir.concat("\\VC\\Include")),
|
new Path(vcDir.concat("Include\\Sys")),
|
||||||
new Path(sdkDir.concat("\\VC\\Include\\Sys")),
|
new Path(sdkDir.concat("Include")),
|
||||||
new Path(sdkDir.concat("\\Include")),
|
new Path(sdkDir.concat("Include\\gl"))
|
||||||
new Path(sdkDir.concat("\\Include\\gl"))
|
};
|
||||||
};
|
} else
|
||||||
|
paths = new IPath[0];
|
||||||
|
|
||||||
symbols.put("_M_IX86", "600");
|
symbols.put("_M_IX86", "600");
|
||||||
symbols.put("_WIN32", "1");
|
symbols.put("_WIN32", "1");
|
||||||
symbols.put("_MSC_VER", "1400");
|
symbols.put("_MSC_VER", "1400");
|
||||||
|
|
|
@ -83,34 +83,76 @@ public class WinEnvironmentVariableSupplier
|
||||||
envvars.put(var.getName(), var);
|
envvars.put(var.getName(), var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
// 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() {
|
private void initvars() {
|
||||||
envvars = new HashMap<String, IBuildEnvironmentVariable>();
|
envvars = new HashMap<String, IBuildEnvironmentVariable>();
|
||||||
|
|
||||||
StringBuffer buff;
|
|
||||||
WindowsRegistry reg = WindowsRegistry.getRegistry();
|
|
||||||
|
|
||||||
// The SDK Location
|
// The SDK Location
|
||||||
String sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0", "InstallationFolder");
|
String sdkDir = getSDKDir();
|
||||||
if (sdkDir == null)
|
if (sdkDir == null)
|
||||||
sdkDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1", "InstallationFolder");
|
return;
|
||||||
|
|
||||||
|
String vcDir = getVCDir();
|
||||||
|
|
||||||
// INCLUDE
|
// INCLUDE
|
||||||
buff = new StringBuffer();
|
StringBuffer buff = new StringBuffer();
|
||||||
buff.append(sdkDir).append("VC\\Include;");
|
buff.append(vcDir).append("Include;");
|
||||||
buff.append(sdkDir).append("VC\\Include\\Sys;");
|
buff.append(vcDir).append("Include\\Sys;");
|
||||||
buff.append(sdkDir).append("Include;");
|
buff.append(sdkDir).append("Include;");
|
||||||
buff.append(sdkDir).append("Include\\gl;");
|
buff.append(sdkDir).append("Include\\gl;");
|
||||||
addvar(new WindowsBuildEnvironmentVariable("INCLUDE", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
|
addvar(new WindowsBuildEnvironmentVariable("INCLUDE", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
|
||||||
|
|
||||||
// LIB
|
// LIB
|
||||||
buff = new StringBuffer();
|
buff = new StringBuffer();
|
||||||
buff.append(sdkDir).append("VC\\Lib;");
|
buff.append(vcDir).append("Lib;");
|
||||||
buff.append(sdkDir).append("Lib;");
|
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(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;");
|
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