use of org.eclipse.cdt.core.settings.model.ICMacroEntry in project m2e-nar by maven-nar.
the class AbstractSettingsSynchroniser method setDefinedSymbols.
private void setDefinedSymbols(final ICConfigurationDescription conf, final NarBuildArtifact settings) throws CoreException {
final ICLanguageSetting[] languageSettings = conf.getRootFolderDescription().getLanguageSettings();
final List<ICMacroEntry> cMacroEntries = new ArrayList<ICMacroEntry>();
for (final String define : settings.getCSettings().getDefines()) {
final String escapedDefine = CdtUtils.escapeOption(define);
ICMacroEntry macroEntry = createMacroEntry(escapedDefine, 0);
cMacroEntries.add(macroEntry);
}
final List<ICMacroEntry> cppMacroEntries = new ArrayList<ICMacroEntry>();
for (final String define : settings.getCppSettings().getDefines()) {
final String escapedDefine = CdtUtils.escapeOption(define);
ICMacroEntry macroEntry = createMacroEntry(escapedDefine, 0);
cppMacroEntries.add(macroEntry);
}
for (ICLanguageSetting setting : languageSettings) {
final List<ICLanguageSettingEntry> l = setting.getSettingEntriesList(ICSettingEntry.MACRO);
l.clear();
if (cppLanguageId.equals(setting.getLanguageId())) {
l.addAll(cppMacroEntries);
} else if (cLanguageId.equals(setting.getLanguageId())) {
l.addAll(cMacroEntries);
}
setting.setSettingEntries(ICSettingEntry.MACRO, l);
}
}
Aggregations