# HG changeset patch # User timkelly # Date 1282833925 18000 # Node ID 1c19331f819a8b2ac3a7a698fc278a4470c4154f # Parent 467f946a6cd1b4c11f3183ad614b733a7a6e742a fix problem constructing macros with values from mmps. Was causing .pro file imports to fail completely. diff -r 467f946a6cd1 -r 1c19331f819a builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Thu Aug 26 08:29:58 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Thu Aug 26 09:45:25 2010 -0500 @@ -1727,8 +1727,8 @@ * @return List of macro strings which may be empty. There is no macro value, only a * string like "FOO". */ - public static List getMMPMacrosForBuildConfiguration(final IPath workspaceRelativeMMPPath, final ICarbideBuildConfiguration buildConfig) { - final List macros = new ArrayList(); + public static List getMMPMacrosForBuildConfiguration(final IPath workspaceRelativeMMPPath, final ICarbideBuildConfiguration buildConfig) { + final List macros = new ArrayList(); EpocEnginePlugin.runWithMMPData(workspaceRelativeMMPPath, new DefaultMMPViewConfiguration(buildConfig.getCarbideProject().getProject(), buildConfig.getBuildContext(), new AcceptedNodesViewFilter()), @@ -1738,8 +1738,14 @@ Map> listArgumentSettings = mmpData.getListArgumentSettings(); List macroList = listArgumentSettings.get(EMMPStatement.MACRO); for (String macro : macroList) { - if (!macros.contains(macro)) { - macros.add(macro); + String macroValue = null; + if (macro.contains("=")){ + macroValue = macro.split("=")[1]; // expansion + macro = macro.split("=")[0]; // name + } + IDefine newDefine = DefineFactory.createDefine(macro, macroValue); + if (!macros.contains(newDefine)) { + macros.add(newDefine); } } return null; @@ -2795,11 +2801,10 @@ // is enabled (Use preprocessor symbols....) for (IPath mmpPath : mmpFiles) { - List mmpMacros = getMMPMacrosForBuildConfiguration( + List mmpMacros = getMMPMacrosForBuildConfiguration( mmpPath, config); - for (String macro : mmpMacros) { - // Symbian docs say they are converted to upper case always - projectDefines.add(DefineFactory.createDefine(macro.toUpperCase())); + if (mmpMacros != null && mmpMacros.size() > 0){ + projectDefines.addAll(mmpMacros); } } }