mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
Wrong active build configuration for Core Build projects. (#380)
Wrong active build configuration for Core Build projects. The CoreBuildLaunchBar tracker always made a non default build configuration the active build configuration. In other words, it always made the debug build configuration active. This caused wrong build flags if a non core build launch configuration was used to launch a core build project binary. Fixed the CoreBuildLaunchBar tracker to set the build configuration to active that matches the launchBar mode. Fixes #378
This commit is contained in:
parent
3e47705d94
commit
9710f17847
2 changed files with 25 additions and 6 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
|
||||||
Bundle-Version: 8.8.0.qualifier
|
Bundle-Version: 8.8.100.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
|
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -100,6 +100,7 @@ public class CoreBuildLaunchBarTracker implements ILaunchBarListener, ILaunchTar
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project == null || !configManager.supports(project)) {
|
if (project == null || !configManager.supports(project)) {
|
||||||
|
// The project is not a Core Build project.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +110,24 @@ public class CoreBuildLaunchBarTracker implements ILaunchBarListener, ILaunchTar
|
||||||
lastDescriptor = descriptor;
|
lastDescriptor = descriptor;
|
||||||
lastTarget = target;
|
lastTarget = target;
|
||||||
|
|
||||||
// Pick build config based on toolchain for target
|
/*
|
||||||
|
* Core build projects do not work with the concept of active build
|
||||||
|
* configurations, like managed build projects. Instead they rely
|
||||||
|
* on the launch mode and launch target set in the launchBar. A core
|
||||||
|
* build launch configuration looks at the launchBar launch mode
|
||||||
|
* and then the set of toolchains associated with the launch target
|
||||||
|
* to pick the build configuration. Core build projects still have an
|
||||||
|
* active build configuration, but it is hidden for the user and ignored for
|
||||||
|
* launching.
|
||||||
|
*
|
||||||
|
* Core build launch configurations have no options to set, so it is
|
||||||
|
* possible that users will use non core build launch configurations to
|
||||||
|
* launch a core build project binary. Non core build launch
|
||||||
|
* configurations typically launch the active build configuration. The
|
||||||
|
* active build configuration needs to match the launchBar launch mode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Pick core build config based on launch mode and toolchain for target
|
||||||
// Since this may create a new config, need to run it in a Job
|
// Since this may create a new config, need to run it in a Job
|
||||||
Job job = new Job(InternalDebugCoreMessages.CoreBuildLaunchBarTracker_Job) {
|
Job job = new Job(InternalDebugCoreMessages.CoreBuildLaunchBarTracker_Job) {
|
||||||
@Override
|
@Override
|
||||||
|
@ -120,11 +138,12 @@ public class CoreBuildLaunchBarTracker implements ILaunchBarListener, ILaunchTar
|
||||||
Collection<IToolChain> tcs = toolChainManager.getToolChainsMatching(properties);
|
Collection<IToolChain> tcs = toolChainManager.getToolChainsMatching(properties);
|
||||||
ICBuildConfiguration buildConfig = null;
|
ICBuildConfiguration buildConfig = null;
|
||||||
if (!tcs.isEmpty()) {
|
if (!tcs.isEmpty()) {
|
||||||
// First, see if any existing non default build configs match the target properties
|
|
||||||
configs: for (IBuildConfiguration config : finalProject.getBuildConfigs()) {
|
configs: for (IBuildConfiguration config : finalProject.getBuildConfigs()) {
|
||||||
if (!config.getName().equals(IBuildConfiguration.DEFAULT_CONFIG_NAME)) {
|
ICBuildConfiguration testConfig = configManager.getBuildConfiguration(config);
|
||||||
ICBuildConfiguration testConfig = configManager.getBuildConfiguration(config);
|
if (testConfig != null && !(testConfig instanceof ErrorBuildConfiguration)) {
|
||||||
if (testConfig != null && !(testConfig instanceof ErrorBuildConfiguration)) {
|
// Match launch mode run/debug.
|
||||||
|
if (testConfig.getLaunchMode().equals(lastMode.getIdentifier())) {
|
||||||
|
// Match toolchain.
|
||||||
for (IToolChain tc : tcs) {
|
for (IToolChain tc : tcs) {
|
||||||
if (testConfig.getToolChain().equals(tc)) {
|
if (testConfig.getToolChain().equals(tc)) {
|
||||||
buildConfig = testConfig;
|
buildConfig = testConfig;
|
||||||
|
|
Loading…
Add table
Reference in a new issue