mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 21:45:22 +02:00
Bug 194641 - reattach the isToolchainSupported to the cygwin toolchain. Also created one for mingw.
Bug 201579 - added the msys directory to the mingw toolchain path if it resides next to the mingw in the eclipse install location's parent.
This commit is contained in:
parent
5e002f83a2
commit
f6ea2409a4
3 changed files with 59 additions and 11 deletions
|
@ -1662,12 +1662,13 @@
|
||||||
</toolChain>
|
</toolChain>
|
||||||
|
|
||||||
<toolChain
|
<toolChain
|
||||||
archList="all"
|
archList="all"
|
||||||
osList="win32"
|
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier"
|
||||||
name="%ToolChainName.Cygwin"
|
id="cdt.managedbuild.toolchain.gnu.cygwin.base"
|
||||||
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier"
|
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.cygwin.IsGnuCygwinToolChainSupported"
|
||||||
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base;cdt.managedbuild.tool.gnu.c.linker.cygwin.base;cdt.managedbuild.tool.gnu.archiver"
|
name="%ToolChainName.Cygwin"
|
||||||
id="cdt.managedbuild.toolchain.gnu.cygwin.base">
|
osList="win32"
|
||||||
|
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base;cdt.managedbuild.tool.gnu.c.linker.cygwin.base;cdt.managedbuild.tool.gnu.archiver">
|
||||||
<targetPlatform
|
<targetPlatform
|
||||||
id="cdt.managedbuild.target.gnu.platform.cygwin.base"
|
id="cdt.managedbuild.target.gnu.platform.cygwin.base"
|
||||||
name="%PlatformName.Dbg"
|
name="%PlatformName.Dbg"
|
||||||
|
@ -1733,6 +1734,7 @@
|
||||||
archList="all"
|
archList="all"
|
||||||
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
|
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
|
||||||
id="cdt.managedbuild.toolchain.gnu.mingw.base"
|
id="cdt.managedbuild.toolchain.gnu.mingw.base"
|
||||||
|
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
|
||||||
name="%ToolChainName.MinGW"
|
name="%ToolChainName.MinGW"
|
||||||
osList="win32"
|
osList="win32"
|
||||||
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver">
|
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver">
|
||||||
|
|
|
@ -89,13 +89,23 @@ public class MingwEnvironmentVariableSupplier implements
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IPath getMsysBinDir() {
|
||||||
|
// Just look in the install location parent dir
|
||||||
|
IPath installPath = new Path(Platform.getInstallLocation().getURL().getFile()).removeLastSegments(1);
|
||||||
|
IPath msysBinPath = installPath.append("msys\\bin");
|
||||||
|
return msysBinPath.toFile().isDirectory() ? msysBinPath : null;
|
||||||
|
}
|
||||||
|
|
||||||
public MingwEnvironmentVariableSupplier() {
|
public MingwEnvironmentVariableSupplier() {
|
||||||
IPath binPath = getBinDir();
|
IPath binPath = getBinDir();
|
||||||
if (binPath != null)
|
if (binPath != null) {
|
||||||
path = new MingwBuildEnvironmentVariable(
|
String pathStr = binPath.toOSString();
|
||||||
"PATH",
|
IPath msysBinPath = getMsysBinDir();
|
||||||
binPath.toOSString(),
|
if (msysBinPath != null)
|
||||||
IBuildEnvironmentVariable.ENVVAR_PREPEND);
|
pathStr += ';' + msysBinPath.toOSString();
|
||||||
|
|
||||||
|
path = new MingwBuildEnvironmentVariable("PATH", pathStr, IBuildEnvironmentVariable.ENVVAR_PREPEND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBuildEnvironmentVariable getVariable(String variableName,
|
public IBuildEnvironmentVariable getVariable(String variableName,
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2007 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.managedbuilder.gnu.mingw;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
|
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Doug Schaefer
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class MingwIsToolChainSupported implements IManagedIsToolChainSupported {
|
||||||
|
|
||||||
|
private final boolean supported;
|
||||||
|
|
||||||
|
public MingwIsToolChainSupported() {
|
||||||
|
// Only supported if we can find the mingw bin dir to run the compiler
|
||||||
|
supported = MingwEnvironmentVariableSupplier.getBinDir() != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSupported(IToolChain toolChain,
|
||||||
|
PluginVersionIdentifier version, String instance) {
|
||||||
|
return supported;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue