38 import org.eclipse.cdt.core.settings.model.extension.CLanguageData; |
38 import org.eclipse.cdt.core.settings.model.extension.CLanguageData; |
39 import org.eclipse.core.resources.IProject; |
39 import org.eclipse.core.resources.IProject; |
40 import org.eclipse.core.resources.ProjectScope; |
40 import org.eclipse.core.resources.ProjectScope; |
41 import org.eclipse.core.runtime.CoreException; |
41 import org.eclipse.core.runtime.CoreException; |
42 import org.eclipse.core.runtime.IPath; |
42 import org.eclipse.core.runtime.IPath; |
|
43 import org.eclipse.core.runtime.NullProgressMonitor; |
43 import org.eclipse.core.runtime.Path; |
44 import org.eclipse.core.runtime.Path; |
44 import org.eclipse.core.runtime.Platform; |
45 import org.eclipse.core.runtime.Platform; |
45 import org.eclipse.core.runtime.content.IContentType; |
46 import org.eclipse.core.runtime.content.IContentType; |
46 import org.eclipse.core.runtime.content.IContentTypeManager; |
47 import org.eclipse.core.runtime.content.IContentTypeManager; |
47 import org.eclipse.core.runtime.content.IContentTypeSettings; |
48 import org.eclipse.core.runtime.content.IContentTypeSettings; |
48 |
49 |
49 import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; |
50 import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; |
50 import com.nokia.carbide.cdt.builder.EpocEngineHelper; |
51 import com.nokia.carbide.cdt.builder.EpocEngineHelper; |
51 import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; |
52 import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; |
|
53 import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo; |
52 import com.nokia.carbide.cpp.epoc.engine.model.sbv.ISBVView; |
54 import com.nokia.carbide.cpp.epoc.engine.model.sbv.ISBVView; |
53 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; |
55 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; |
54 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; |
56 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; |
55 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; |
57 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; |
56 import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; |
58 import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; |
300 |
302 |
301 // vendor macros (e.g. __SERIES60_3x__) |
303 // vendor macros (e.g. __SERIES60_3x__) |
302 for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros()) { |
304 for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros()) { |
303 macros.put(builtinMacro, ""); //$NON-NLS-1$ |
305 macros.put(builtinMacro, ""); //$NON-NLS-1$ |
304 } |
306 } |
|
307 |
|
308 // built in macros |
|
309 for (String builtinMacro : sbsv1BuildInfo.getBuiltinMacros(context)) { |
|
310 macros.put(builtinMacro, ""); //$NON-NLS-1$ |
|
311 } |
|
312 |
305 } else { |
313 } else { |
306 ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); |
314 ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); |
307 // platform macros |
315 // platform macros |
308 macros.putAll(sbsv2BuildInfo.getPlatformMacros(carbideBuildConfig.getPlatformString())); |
316 macros.putAll(sbsv2BuildInfo.getPlatformMacros(carbideBuildConfig.getPlatformString())); |
309 } |
317 } |
310 |
318 |
311 // built in macros |
319 if (carbideBuildConfig.hasSTDCPPSupport()){ |
312 for (String builtinMacro : carbideBuildConfig.getBuiltinMacros()) { |
320 macros.put("__SYMBIAN_STDCPP_SUPPORT__", ""); |
313 macros.put(builtinMacro, ""); //$NON-NLS-1$ |
|
314 } |
321 } |
315 |
322 |
316 // target type macros (e.g. __DLL__) |
323 // target type macros (e.g. __DLL__) |
317 List<String> targetTypes = EpocEngineHelper.getTargetTypesForBuildConfiguration(carbideBuildConfig); |
324 List<String> targetTypes = EpocEngineHelper.getTargetTypesForBuildConfiguration(carbideBuildConfig); |
318 // only add these if there is one target type. this is the case when there is only one mmp file, or |
325 // only add these if there is one target type. this is the case when there is only one mmp file, or |
374 |
381 |
375 // save the time so we can test later if any of the bld.inf or mmp files have changed since we created |
382 // save the time so we can test later if any of the bld.inf or mmp files have changed since we created |
376 // the cache. |
383 // the cache. |
377 cacheTimestamp = System.currentTimeMillis(); |
384 cacheTimestamp = System.currentTimeMillis(); |
378 } |
385 } |
379 |
386 |
380 private void persistCache() { |
387 private void persistCache() { |
381 // persist the cache between IDE launches. |
388 // persist the cache between IDE launches. |
382 try { |
389 try { |
383 final IProject project = carbideBuildConfig.getCarbideProject().getProject(); |
390 final IProject project = carbideBuildConfig.getCarbideProject().getProject(); |
384 ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); |
391 ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); |