work to get EpocEngineHelper#getGlobalDefinesForConfiguration(ICarbideBuildConfiguration config, List<IPath> mmpFiles) working properly. Gets the configuration indexer data cache macros set up properly.
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Thu Aug 12 17:32:31 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Fri Aug 13 10:30:38 2010 -0500
@@ -142,6 +142,7 @@
monitor.beginTask("Scanning bld.inf for mmp and make files", buildConfigs.size());
try {
+
// let cache know we're iterating a lot
SymbianBuildContextDataCache.startProjectOperation();
@@ -2777,33 +2778,23 @@
List<IDefine> projectDefines = config.getCompileTimeMacros();
- boolean indexAllMMPs = false;
if (mmpFiles == null){
// get all macros from all mmps
- indexAllMMPs = true;
mmpFiles = getMMPFilesForProject(config.getCarbideProject());
}
- boolean foundStdCPPSupport = false;
for (IPath mmpPath : mmpFiles){
- if (!foundStdCPPSupport && hasSTDCPPSupport(config.getCarbideProject(), mmpPath)){
+ if (hasSTDCPPSupport(config.getCarbideProject(), mmpPath)){
projectDefines.add(DefineFactory.createDefine("__SYMBIAN_STDCPP_SUPPORT__"));
- foundStdCPPSupport = true;
+ break;
}
}
- // get the list of all mmp files selected for the build configuration
- // a null buildComponents list means all MMPs are included - so leave it null when indexing all files
- List<String> buildComponents = null;
- if (!EpocEngineHelper.getIndexAllPreference() || !indexAllMMPs)
- buildComponents = config.getCarbideProject().isBuildingFromInf() ? null : config.getCarbideProject().getInfBuildComponents();
-
if (((CarbideProjectInfo)config.getCarbideProject()).shouldUseMMPMacros()){
+ // Only return the macros from the mmps if project pref Macro Settings
+ // is enabled (Use preprocessor symbols....)
for (IPath mmpPath : mmpFiles) {
- if (buildComponents != null && !TextUtils.listContainsIgnoreCase(buildComponents, mmpPath.lastSegment()))
- continue;
-
List<String> mmpMacros = getMMPMacrosForBuildConfiguration(
mmpPath, config);
for (String macro : mmpMacros) {
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/MMPSelectionUI.java Thu Aug 12 17:32:31 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/MMPSelectionUI.java Fri Aug 13 10:30:38 2010 -0500
@@ -17,6 +17,7 @@
package com.nokia.carbide.cdt.internal.api.builder.ui;
import com.nokia.carbide.cdt.builder.EpocEngineHelper;
+import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IExtension;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
@@ -168,7 +169,7 @@
private Button excludeExtensionMakefilesCheckbox;
private Button excludeTestComponentsCheckbox;
private ListenerList<ISelectionChangedListener> listeners;
- private List<? extends ISymbianBuildContext> buildConfigs;
+ private List<ISymbianBuildContext> buildConfigs;
private IPath bldInfFile;
private final IRunnableContext runnableContext;
private List<FileInfo> data = Collections.emptyList();
@@ -370,12 +371,12 @@
* @param bldInfFile IPath
* @param buildConfigs List<ISymbianBuildContext>
*/
- public void setBldInfFile(final IPath bldInfFile, final List buildConfigs, final boolean useSBSv2Builder) {
+ public void setBldInfFile(final IPath bldInfFile, final List<ISymbianBuildContext> buildContexts, final boolean useSBSv2Builder) {
if (bldInfFile.equals(this.bldInfFile) && buildConfigs.equals(this.buildConfigs))
return;
this.bldInfFile = bldInfFile;
- this.buildConfigs = buildConfigs;
+ this.buildConfigs = buildContexts;
this.useSBSv2Builder = useSBSv2Builder;
try {
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Thu Aug 12 17:32:31 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Fri Aug 13 10:30:38 2010 -0500
@@ -301,7 +301,14 @@
List<IPath> mmpFiles = null;
List<IDefine> projectDefines = new ArrayList<IDefine>();
if (buildComponents != null){
- mmpFiles = EpocEngineHelper.getMMPFilesForBuildConfiguration(carbideBuildConfig);
+ // Get the list of mmp files we are building so we only get those macros
+ List<IPath> tmpMMPFiles = EpocEngineHelper.getMMPFilesForBuildConfiguration(carbideBuildConfig);
+ mmpFiles = new ArrayList<IPath>();
+ for (IPath mmp : tmpMMPFiles){
+ if (TextUtils.listContainsIgnoreCase(buildComponents, mmp.lastSegment())){
+ mmpFiles.add(mmp);
+ }
+ }
}
projectDefines = EpocEngineHelper.getGlobalDefinesForConfiguration(carbideBuildConfig, mmpFiles);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/CarbideCPPProjectSettingsPage.java Thu Aug 12 17:32:31 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/CarbideCPPProjectSettingsPage.java Fri Aug 13 10:30:38 2010 -0500
@@ -401,7 +401,11 @@
selectionUI.setLayoutData(gridData);
// set the data
- selectionUI.setBldInfFile(cpi.getAbsoluteBldInfPath(), cpi.getBuildConfigurations(), CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(cpi.getProject()));
+ List<ISymbianBuildContext> buildContexts = new ArrayList<ISymbianBuildContext>();
+ for (ICarbideBuildConfiguration config : cpi.getBuildConfigurations()){
+ buildContexts.add(config.getBuildContext());
+ }
+ selectionUI.setBldInfFile(cpi.getAbsoluteBldInfPath(), buildContexts, CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(cpi.getProject()));
// set checked state
selectionUI.setAllChecked(false);
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Thu Aug 12 17:32:31 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Fri Aug 13 10:30:38 2010 -0500
@@ -477,7 +477,10 @@
}
// also search files in same folder as variant.hrh
- File prefix = context.getPrefixFromVariantCfg().toFile();
+ File prefix = null;
+ if (context.getPrefixFromVariantCfg() != null){
+ prefix = context.getPrefixFromVariantCfg().toFile();
+ }
if (sbvPlatform != null){
// might be an alternate HRH file to use
IPath varVarHRH = sbvPlatform.getBuildVariantHRHFile();