@@ -33,14 +33,13 @@ private enum State {
33
33
34
34
private State state = State .NONE ;
35
35
36
- @ SuppressWarnings ("nls" )
37
36
private static final AbstractOptionParser [] optionParsers = {
38
- new IncludePathOptionParser ("#include \" (\\ S.*)\" " , "$1" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY | ICSettingEntry .LOCAL ),
39
- new IncludePathOptionParser ("#include <(\\ S.*)>" , "$1" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY ),
40
- new IncludePathOptionParser ("#framework <(\\ S.*)>" , "$1" ,
37
+ new IncludePathOptionParser ("#include \" (\\ S.*)\" " , "$1" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY | ICSettingEntry .LOCAL ), //$NON-NLS-1$ //$NON-NLS-2$
38
+ new IncludePathOptionParser ("#include <(\\ S.*)>" , "$1" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY ), //$NON-NLS-1$ //$NON-NLS-2$
39
+ new IncludePathOptionParser ("#framework <(\\ S.*)>" , "$1" , //$NON-NLS-1$ //$NON-NLS-2$
41
40
ICSettingEntry .BUILTIN | ICSettingEntry .READONLY | ICSettingEntry .FRAMEWORKS_MAC ),
42
- new MacroOptionParser ("#define\\ s+(\\ S*\\ (.*?\\ ))\\ s*(.*)" , "$1" , "$2" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY ),
43
- new MacroOptionParser ("#define\\ s+(\\ S*)\\ s*(\\ S*)" , "$1" , "$2" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY ), };
41
+ new MacroOptionParser ("#define\\ s+(\\ S*\\ (.*?\\ ))\\ s*(.*)" , "$1" , "$2" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY ), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
42
+ new MacroOptionParser ("#define\\ s+(\\ S*)\\ s*(\\ S*)" , "$1" , "$2" , ICSettingEntry .BUILTIN | ICSettingEntry .READONLY ), }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
44
43
45
44
@ Override
46
45
public String getToolchainId () {
@@ -61,44 +60,43 @@ private static List<String> makeList(String line) {
61
60
return list ;
62
61
}
63
62
64
- @ SuppressWarnings ("nls" )
65
63
@ Override
66
64
protected List <String > parseOptions (String lineIn ) {
67
65
String line = lineIn .trim ();
68
66
69
67
// contribution of -dD option
70
- if (line .startsWith ("#define" )) {
68
+ if (line .startsWith ("#define" )) { //$NON-NLS-1$
71
69
return makeList (line );
72
70
}
73
71
74
72
// contribution of includes
75
- if (line .equals ("#include \" ...\" search starts here:" )) {
73
+ if (line .equals ("#include \" ...\" search starts here:" )) { //$NON-NLS-1$
76
74
this .state = State .EXPECTING_LOCAL_INCLUDE ;
77
- } else if (line .equals ("#include <...> search starts here:" )) {
75
+ } else if (line .equals ("#include <...> search starts here:" )) { //$NON-NLS-1$
78
76
this .state = State .EXPECTING_SYSTEM_INCLUDE ;
79
- } else if (line .startsWith ("End of search list." )) {
77
+ } else if (line .startsWith ("End of search list." )) { //$NON-NLS-1$
80
78
this .state = State .NONE ;
81
- } else if (line .equals ("Framework search starts here:" )) {
79
+ } else if (line .equals ("Framework search starts here:" )) { //$NON-NLS-1$
82
80
this .state = State .EXPECTING_FRAMEWORKS ;
83
- } else if (line .startsWith ("End of framework search list." )) {
81
+ } else if (line .startsWith ("End of framework search list." )) { //$NON-NLS-1$
84
82
this .state = State .NONE ;
85
83
} else if (this .state == State .EXPECTING_LOCAL_INCLUDE ) {
86
84
// making that up for the parser to figure out
87
- line = "#include \" " + line + "\" " ;
85
+ line = "#include \" " + line + "\" " ; //$NON-NLS-1$ //$NON-NLS-2$
88
86
return makeList (line );
89
87
} else {
90
- String frameworkIndicator = "(framework directory)" ;
88
+ String frameworkIndicator = "(framework directory)" ; //$NON-NLS-1$
91
89
if (this .state == State .EXPECTING_SYSTEM_INCLUDE ) {
92
90
// making that up for the parser to figure out
93
91
if (line .contains (frameworkIndicator )) {
94
- line = "#framework <" + line .replace (frameworkIndicator , "" ).trim () + ">" ;
92
+ line = "#framework <" + line .replace (frameworkIndicator , "" ).trim () + ">" ; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
95
93
} else {
96
- line = "#include <" + line + ">" ;
94
+ line = "#include <" + line + ">" ; //$NON-NLS-1$ //$NON-NLS-2$
97
95
}
98
96
return makeList (line );
99
97
} else if (this .state == State .EXPECTING_FRAMEWORKS ) {
100
98
// making that up for the parser to figure out
101
- line = "#framework <" + line .replace (frameworkIndicator , "" ).trim () + ">" ;
99
+ line = "#framework <" + line .replace (frameworkIndicator , "" ).trim () + ">" ; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
102
100
return makeList (line );
103
101
}
104
102
}
@@ -143,6 +141,7 @@ protected String getCompilerCommand(String languageId) {
143
141
// IContributedEnvironment contribEnv =
144
142
// envManager.getContributedEnvironment();
145
143
ICConfigurationDescription confDesc = prjDesc .getActiveConfiguration ();
144
+
146
145
// Bug fix for CDT 8.1 fixed in 8.2
147
146
IFolder buildFolder = this .currentProject .getFolder (confDesc .getName ());
148
147
if (!buildFolder .exists ()) {
@@ -187,12 +186,12 @@ protected String getCompilerCommand(String languageId) {
187
186
ManagedBuilderCorePlugin .error ("Unable to find compiler command for language " + languageId + " in toolchain=" + getToolchainId ()); //$NON-NLS-1$ //$NON-NLS-2$
188
187
}
189
188
190
- String ret = compilerCommand .replaceAll ("[^\\ \\ ]\" \" " , Const .EMPTY_STRING ).replaceAll (" " , " " ); // remove //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
189
+ String ret = compilerCommand .replaceAll (" -MMD " , " " ). replaceAll ( " [^\\ \\ ]\" \" " , Const .EMPTY_STRING ).replaceAll (" " , " " ); // remove //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5 $
191
190
// "" except \""
192
191
// and
193
192
// double
194
193
// blanks
195
194
return ret ;
196
195
}
197
196
198
- }
197
+ }
0 commit comments