mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug #182450 - Multi-cfg
This commit is contained in:
parent
94f89a6d02
commit
f497803515
3 changed files with 21 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -188,35 +188,30 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
* 3: cfg.getInternalBuilderParallel()
|
* 3: cfg.getInternalBuilderParallel()
|
||||||
*/
|
*/
|
||||||
static int[] calc3states(ICPropertyProvider p,
|
static int[] calc3states(ICPropertyProvider p,
|
||||||
Button b3,
|
|
||||||
IConfiguration c,
|
IConfiguration c,
|
||||||
boolean p0) {
|
boolean p0) {
|
||||||
if (p.isMultiCfg() &&
|
if (p.isMultiCfg() &&
|
||||||
c instanceof ICMultiItemsHolder)
|
c instanceof ICMultiItemsHolder)
|
||||||
{
|
{
|
||||||
IConfiguration[] cfs = (IConfiguration[])((ICMultiItemsHolder)c).getItems();
|
IConfiguration[] cfs = (IConfiguration[])((ICMultiItemsHolder)c).getItems();
|
||||||
IBuilder b = cfs[0].getEditableBuilder();
|
IBuilder b = cfs[0].getBuilder();
|
||||||
int[] res = new int[TRI_STATES_SIZE];
|
int[] res = new int[TRI_STATES_SIZE];
|
||||||
boolean[] x = new boolean[TRI_STATES_SIZE];
|
boolean[] x = new boolean[TRI_STATES_SIZE];
|
||||||
x[0] = (p0) ? b.isManagedBuildOn() : b.isStopOnError();
|
x[0] = p0 ? b.isManagedBuildOn() : b.isStopOnError();
|
||||||
x[1] = (p0) ? b.isDefaultBuildCmd(): b.supportsStopOnError(true);
|
x[1] = p0 ? b.isDefaultBuildCmd(): b.supportsStopOnError(true);
|
||||||
x[2] = (p0) ? b.canKeepEnvironmentVariablesInBuildfile() :
|
x[2] = p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
|
||||||
b.supportsStopOnError(false);
|
b.supportsStopOnError(false);
|
||||||
x[3] = (p0) ? b.keepEnvironmentVariablesInBuildfile() :
|
x[3] = p0 ? b.keepEnvironmentVariablesInBuildfile() :
|
||||||
((Configuration)cfs[0]).getInternalBuilderParallel();
|
((Configuration)cfs[0]).getInternalBuilderParallel();
|
||||||
for (int i=1; i<cfs.length; i++) {
|
for (int i=1; i<cfs.length; i++) {
|
||||||
b = cfs[i].getEditableBuilder();
|
b = cfs[i].getBuilder();
|
||||||
if (res[0] != TRI_UNKNOWN &&
|
if (x[0] != (p0 ? b.isManagedBuildOn() : b.isStopOnError()))
|
||||||
x[0] != (p0) ? b.isManagedBuildOn() : b.isStopOnError())
|
|
||||||
res[0] = TRI_UNKNOWN;
|
res[0] = TRI_UNKNOWN;
|
||||||
if (res[1] != TRI_UNKNOWN &&
|
if (x[1] != (p0 ? b.isDefaultBuildCmd() : b.supportsStopOnError(true)))
|
||||||
x[1] != (p0) ? b.isDefaultBuildCmd() : b.supportsStopOnError(true))
|
|
||||||
res[1] = TRI_UNKNOWN;
|
res[1] = TRI_UNKNOWN;
|
||||||
if (res[2] != TRI_UNKNOWN &&
|
if (x[2] != (p0 ? b.canKeepEnvironmentVariablesInBuildfile() : b.supportsStopOnError(false)))
|
||||||
x[2] != (p0) ? b.canKeepEnvironmentVariablesInBuildfile() : b.supportsStopOnError(false))
|
|
||||||
res[2] = TRI_UNKNOWN;
|
res[2] = TRI_UNKNOWN;
|
||||||
if (res[3] != TRI_UNKNOWN &&
|
if (x[3] != (p0 ? b.keepEnvironmentVariablesInBuildfile() : ((Configuration)cfs[i]).getInternalBuilderParallel()))
|
||||||
x[3] != (p0) ? b.keepEnvironmentVariablesInBuildfile() : ((Configuration)cfs[i]).getInternalBuilderParallel())
|
|
||||||
res[3] = TRI_UNKNOWN;
|
res[3] = TRI_UNKNOWN;
|
||||||
}
|
}
|
||||||
for (int i=0; i<TRI_STATES_SIZE; i++) {
|
for (int i=0; i<TRI_STATES_SIZE; i++) {
|
||||||
|
@ -234,7 +229,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
protected void updateButtons() {
|
protected void updateButtons() {
|
||||||
bldr = icfg.getEditableBuilder();
|
bldr = icfg.getEditableBuilder();
|
||||||
|
|
||||||
int[] extStates = calc3states(page, b_stopOnError, icfg, false);
|
int[] extStates = calc3states(page, icfg, false);
|
||||||
|
|
||||||
if (extStates != null) {
|
if (extStates != null) {
|
||||||
setTriSelection(b_stopOnError, extStates[0]);
|
setTriSelection(b_stopOnError, extStates[0]);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -126,7 +126,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
protected void updateButtons() {
|
protected void updateButtons() {
|
||||||
bldr = icfg.getEditableBuilder();
|
bldr = icfg.getEditableBuilder();
|
||||||
|
|
||||||
int[] extStates = BuildBehaviourTab.calc3states(page, b_useDefault, icfg, true);
|
int[] extStates = BuildBehaviourTab.calc3states(page, icfg, true);
|
||||||
|
|
||||||
b_genMakefileAuto.setEnabled(icfg.supportsBuild(true));
|
b_genMakefileAuto.setEnabled(icfg.supportsBuild(true));
|
||||||
if (extStates == null) { // no extended states available
|
if (extStates == null) { // no extended states available
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -526,6 +526,12 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
||||||
return fFontMetrics;
|
return fFontMetrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets checkbox to appropriate state:
|
||||||
|
* unchecked, checked or unknown (grayed)
|
||||||
|
* @param b - checkbox to set
|
||||||
|
* @param state
|
||||||
|
*/
|
||||||
public static void setTriSelection(Button b, int state) {
|
public static void setTriSelection(Button b, int state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case TRI_NO:
|
case TRI_NO:
|
||||||
|
|
Loading…
Add table
Reference in a new issue