Skip to main content
summaryrefslogtreecommitdiffstats
path: root/qt
diff options
context:
space:
mode:
authorDoug Schaefer2017-10-17 11:35:03 -0400
committerDoug Schaefer2017-10-17 11:35:03 -0400
commit736d7b59550dcb1a20ab68020bd030cc4d7b086e (patch)
tree86f810f1a5558bb6da1609ab1868d216bdd6e8c4 /qt
parent2198597a98741dfc9c9a7cf574f7b7e75be4d269 (diff)
downloadorg.eclipse.cdt-736d7b59550dcb1a20ab68020bd030cc4d7b086e.tar.gz
org.eclipse.cdt-736d7b59550dcb1a20ab68020bd030cc4d7b086e.tar.xz
org.eclipse.cdt-736d7b59550dcb1a20ab68020bd030cc4d7b086e.zip
Make Qt toolchain selection more resilient.
On my Windows box I have lots of GCC toolchains. Make sure it selects the one from the Qt install. And fix a few NPEs and things around that. Change-Id: Ifeeca9271b5055ac773b3b77e372a67e07305130
Diffstat (limited to 'qt')
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java6
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtMinGWToolChainProvider.java2
-rw-r--r--qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/launch/QtBuildTab.java4
3 files changed, 7 insertions, 5 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java
index a26a8a9c16..ef98046d51 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java
@@ -10,7 +10,6 @@ package org.eclipse.cdt.internal.qt.core.build;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
import org.eclipse.cdt.core.build.ICBuildConfigurationProvider;
@@ -24,9 +23,7 @@ import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
public class QtBuildConfigurationProvider implements ICBuildConfigurationProvider {
@@ -105,8 +102,7 @@ public class QtBuildConfigurationProvider implements ICBuildConfigurationProvide
configManager.addBuildConfiguration(config, qtConfig);
return qtConfig;
} else {
- throw new CoreException(
- new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, Messages.QtBuildConfigurationProvider_NoQtInstall));
+ return null;
}
}
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtMinGWToolChainProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtMinGWToolChainProvider.java
index 29a11caf64..900db87fe2 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtMinGWToolChainProvider.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtMinGWToolChainProvider.java
@@ -56,12 +56,14 @@ public class QtMinGWToolChainProvider implements IToolChainProvider {
IEnvironmentVariable.ENVVAR_PREPEND, File.pathSeparator) };
GCCToolChain toolChain = new GCCToolChain(this, path.resolve(gcc),
Platform.ARCH_X86, env);
+ toolChain.setProperty(IToolChain.ATTR_OS, Platform.OS_WIN32);
toolChain.setProperty(IToolChain.ATTR_PACKAGE, "qt"); //$NON-NLS-1$
manager.addToolChain(toolChain);
if (Platform.getOSArch().equals(Platform.ARCH_X86_64)) {
toolChain = new GCCToolChain(this, path.resolve(gcc), Platform.ARCH_X86_64,
env);
+ toolChain.setProperty(IToolChain.ATTR_OS, Platform.OS_WIN32);
toolChain.setProperty(IToolChain.ATTR_PACKAGE, "qt"); //$NON-NLS-1$
manager.addToolChain(toolChain);
}
diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/launch/QtBuildTab.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/launch/QtBuildTab.java
index e03995a708..953bf59693 100644
--- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/launch/QtBuildTab.java
+++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/launch/QtBuildTab.java
@@ -65,6 +65,10 @@ public class QtBuildTab extends CommonBuildTab {
public void initializeFrom(ILaunchConfiguration configuration) {
try {
ICBuildConfiguration buildConfig = getBuildConfiguration();
+ if (buildConfig == null) {
+ return;
+ }
+
// qmake command
IToolChainManager tcManager = Activator.getService(IToolChainManager.class);
IQtInstallManager qtManager = Activator.getService(IQtInstallManager.class);

Back to the top