mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
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
This commit is contained in:
parent
aedf6d8fa9
commit
dc4be72b1a
2 changed files with 13 additions and 2 deletions
|
@ -15,9 +15,11 @@ import java.util.regex.Pattern;
|
||||||
import org.eclipse.cdt.build.gcc.core.ClangToolChain;
|
import org.eclipse.cdt.build.gcc.core.ClangToolChain;
|
||||||
import org.eclipse.cdt.build.gcc.core.GCCToolChain;
|
import org.eclipse.cdt.build.gcc.core.GCCToolChain;
|
||||||
import org.eclipse.cdt.build.gcc.core.GCCToolChain.GCCInfo;
|
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.IToolChain;
|
||||||
import org.eclipse.cdt.core.build.IToolChainManager;
|
import org.eclipse.cdt.core.build.IToolChainManager;
|
||||||
import org.eclipse.cdt.core.build.IToolChainProvider;
|
import org.eclipse.cdt.core.build.IToolChainProvider;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,8 +68,15 @@ public class GCCPathToolChainProvider implements IToolChainProvider {
|
||||||
gcc.setProperty(IToolChain.ATTR_OS, Platform.OS_MACOSX);
|
gcc.setProperty(IToolChain.ATTR_OS, Platform.OS_MACOSX);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
if (manager.getToolChain(gcc.getTypeId(), gcc.getId()) == null) {
|
||||||
|
// Only add if another provider hasn't already added it
|
||||||
manager.addToolChain(gcc);
|
manager.addToolChain(gcc);
|
||||||
}
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
CCorePlugin.log(e.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Activator.log(e);
|
Activator.log(e);
|
||||||
|
|
|
@ -149,7 +149,9 @@ public abstract class CBuildConfiguration extends PlatformObject
|
||||||
Preferences settings = getSettings();
|
Preferences settings = getSettings();
|
||||||
settings.put(TOOLCHAIN_TYPE, toolChain.getTypeId());
|
settings.put(TOOLCHAIN_TYPE, toolChain.getTypeId());
|
||||||
settings.put(TOOLCHAIN_ID, toolChain.getId());
|
settings.put(TOOLCHAIN_ID, toolChain.getId());
|
||||||
|
if (launchMode != null) {
|
||||||
settings.put(LAUNCH_MODE, launchMode);
|
settings.put(LAUNCH_MODE, launchMode);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
settings.flush();
|
settings.flush();
|
||||||
} catch (BackingStoreException e) {
|
} catch (BackingStoreException e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue