1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

bug 416786: added message in log to indicate invalid option type used in .cproject

This commit is contained in:
Andrew Gvozdev 2013-09-10 10:02:20 -04:00
parent 67aac2386d
commit b61d716173
2 changed files with 29 additions and 21 deletions

View file

@ -44,6 +44,8 @@ import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData;
import org.eclipse.cdt.managedbuilder.macros.IOptionContextData;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.Version;
public class Option extends BuildObject implements IOption, IBuildPropertiesRestriction {
@ -776,7 +778,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} else if (valueTypeStr.equals(TYPE_TREE)) {
return TREE;
} else {
// TODO: This was the CDT 2.0 default - should we keep it?
ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
"Invalid option type=\"" + valueTypeStr + "\" specified for option " + getId() )); //$NON-NLS-1$ //$NON-NLS-2$
// This was the CDT 2.0 default
return PREPROCESSOR_SYMBOLS;
}
}

View file

@ -233,29 +233,33 @@ public class BuildEntryStorage extends AbstractEntryStorage {
List<UserEntryInfo> entryList = new ArrayList<UserEntryInfo>();
for (IOption opt : options) {
Option option = (Option)opt;
@SuppressWarnings("unchecked")
List<OptionStringValue> list = usr ? (List<OptionStringValue>)option.getExactValue() : (List<OptionStringValue>)option.getExactBuiltinsList();
if (list != null) {
SupplierBasedCdtVariableSubstitutor subst = createSubstitutor(option, false);
SupplierBasedCdtVariableSubstitutor bSVarsSubst = createSubstitutor(option, true);
for (int j = 0; j < list.size(); j++) {
OptionStringValue ve = list.get(j);
OptionStringValue[] rVes = resolve(ve, option, bSVarsSubst);
if (rVes.length == 0) {
// If not resolved, add EmptyEntryInfo based off the value entry
if (emptyValuesInfos != null) {
emptyValuesInfos.add(new EmptyEntryInfo(ve, j));
}
} else {
// If resolved, add each resolved entry as a separate UserEntryInfo
boolean isMultiple = rVes.length > 1;
List<UserEntryInfo> sequense = isMultiple ? new ArrayList<UserEntryInfo>(rVes.length) : null;
for (OptionStringValue rVe : rVes) {
ICLanguageSettingEntry entry = createUserEntry(option, rVe, flags, subst);
entryList.add(new UserEntryInfo(entry, ve, rVe, sequense));
try {
@SuppressWarnings("unchecked")
List<OptionStringValue> list = usr ? (List<OptionStringValue>)option.getExactValue() : (List<OptionStringValue>)option.getExactBuiltinsList();
if (list != null) {
SupplierBasedCdtVariableSubstitutor subst = createSubstitutor(option, false);
SupplierBasedCdtVariableSubstitutor bSVarsSubst = createSubstitutor(option, true);
for (int j = 0; j < list.size(); j++) {
OptionStringValue ve = list.get(j);
OptionStringValue[] rVes = resolve(ve, option, bSVarsSubst);
if (rVes.length == 0) {
// If not resolved, add EmptyEntryInfo based off the value entry
if (emptyValuesInfos != null) {
emptyValuesInfos.add(new EmptyEntryInfo(ve, j));
}
} else {
// If resolved, add each resolved entry as a separate UserEntryInfo
boolean isMultiple = rVes.length > 1;
List<UserEntryInfo> sequense = isMultiple ? new ArrayList<UserEntryInfo>(rVes.length) : null;
for (OptionStringValue rVe : rVes) {
ICLanguageSettingEntry entry = createUserEntry(option, rVe, flags, subst);
entryList.add(new UserEntryInfo(entry, ve, rVe, sequense));
}
}
}
}
} catch (Exception e) {
ManagedBuilderCorePlugin.log(e);
}
}