1 | /* |
---|
2 | * Copyright (c) 2008 |
---|
3 | * Embedded Brains GmbH |
---|
4 | * Obere Lagerstr. 30 |
---|
5 | * D-82178 Puchheim |
---|
6 | * Germany |
---|
7 | * rtems@embedded-brains.de |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be found in the file |
---|
10 | * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. |
---|
11 | */ |
---|
12 | |
---|
13 | package org.rtems.cdt.build; |
---|
14 | |
---|
15 | import org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider; |
---|
16 | import org.eclipse.core.resources.IProject; |
---|
17 | import org.eclipse.core.runtime.CoreException; |
---|
18 | import org.eclipse.core.runtime.Path; |
---|
19 | import org.rtems.cdt.Constants; |
---|
20 | import org.rtems.cdt.Storage; |
---|
21 | |
---|
22 | public class RunScannerInfoProvider extends GCCSpecsRunSIProvider { |
---|
23 | protected boolean initialize() { |
---|
24 | if (!super.initialize()) { |
---|
25 | return false; |
---|
26 | } |
---|
27 | |
---|
28 | IProject project = resource.getProject(); |
---|
29 | |
---|
30 | /* |
---|
31 | * FIXME: This is a hack to avoid to early discovery of internal |
---|
32 | * compiler include paths and symbols. The discovery is suppressed for |
---|
33 | * empty projects which contain only the '.project' and '.cproject' |
---|
34 | * files. |
---|
35 | */ |
---|
36 | try { |
---|
37 | if (project.members().length < 3) { |
---|
38 | return false; |
---|
39 | } |
---|
40 | } catch (CoreException e) { |
---|
41 | e.printStackTrace(); |
---|
42 | return false; |
---|
43 | } |
---|
44 | |
---|
45 | /* |
---|
46 | * FIXME: Added absolute path since it seams that the build |
---|
47 | * environment is ignored. |
---|
48 | */ |
---|
49 | fCompileCommand = new Path( |
---|
50 | Storage.getProperty( project, Constants.BASE_PATH_KEY) |
---|
51 | ); |
---|
52 | fCompileCommand = fCompileCommand.append( "bin"); |
---|
53 | fCompileCommand = fCompileCommand.append( |
---|
54 | Storage.getProperty( project, Constants.TOOL_COMPILER_C_KEY) |
---|
55 | ); |
---|
56 | |
---|
57 | return true; |
---|
58 | } |
---|
59 | } |
---|