Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2017-11-20 13:28:22 -0500
committerDoug Schaefer2017-11-20 13:28:22 -0500
commitdc4be72b1ae13020fcbd8dbb46f8c6f9b9eb973b (patch)
tree05e0cd9927d9179fd510a4312b0226a5415d6ad7
parentaedf6d8fa96c55c4e9fded7dba3c158a6493586f (diff)
downloadorg.eclipse.cdt-dc4be72b1ae13020fcbd8dbb46f8c6f9b9eb973b.tar.gz
org.eclipse.cdt-dc4be72b1ae13020fcbd8dbb46f8c6f9b9eb973b.tar.xz
org.eclipse.cdt-dc4be72b1ae13020fcbd8dbb46f8c6f9b9eb973b.zip
Fix MSYS2 so that it's provider overrides the path provider.
Also handle case when launchMode is null when creating a build config. Change-Id: Ie70de785168c2e24c842d517c64a297ba44e24f4
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java11
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java4
2 files changed, 13 insertions, 2 deletions
diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java
index cc2d84069a..dae4f2df0d 100644
--- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java
+++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java
@@ -15,9 +15,11 @@ import java.util.regex.Pattern;
import org.eclipse.cdt.build.gcc.core.ClangToolChain;
import org.eclipse.cdt.build.gcc.core.GCCToolChain;
import org.eclipse.cdt.build.gcc.core.GCCToolChain.GCCInfo;
+import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.build.IToolChainManager;
import org.eclipse.cdt.core.build.IToolChainProvider;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
/**
@@ -66,7 +68,14 @@ public class GCCPathToolChainProvider implements IToolChainProvider {
gcc.setProperty(IToolChain.ATTR_OS, Platform.OS_MACOSX);
break;
}
- manager.addToolChain(gcc);
+ try {
+ if (manager.getToolChain(gcc.getTypeId(), gcc.getId()) == null) {
+ // Only add if another provider hasn't already added it
+ manager.addToolChain(gcc);
+ }
+ } catch (CoreException e) {
+ CCorePlugin.log(e.getStatus());
+ }
}
}
} catch (IOException e) {
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
index 92f5f8eb69..8bd5cc76e6 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
@@ -149,7 +149,9 @@ public abstract class CBuildConfiguration extends PlatformObject
Preferences settings = getSettings();
settings.put(TOOLCHAIN_TYPE, toolChain.getTypeId());
settings.put(TOOLCHAIN_ID, toolChain.getId());
- settings.put(LAUNCH_MODE, launchMode);
+ if (launchMode != null) {
+ settings.put(LAUNCH_MODE, launchMode);
+ }
try {
settings.flush();
} catch (BackingStoreException e) {

Back to the top