MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / HandleToolOption

Function HandleToolOption

tools/targets/eclipse.py:178–356  ·  view source on GitHub ↗
(tools, env, project, reset)

Source from the content-addressed store, hash-verified

176
177
178def HandleToolOption(tools, env, project, reset):
179 is_cpp_prj = IsCppProject()
180 BSP_ROOT = os.path.abspath(env['BSP_ROOT'])
181
182 CPPDEFINES = project['CPPDEFINES']
183 paths = [ConverToRttEclipsePathFormat(RelativeProjectPath(env, os.path.normpath(i)).replace('\\', '/')) for i in project['CPPPATH']]
184
185 compile_include_paths_options = []
186 compile_include_files_options = []
187 compile_defs_options = []
188 linker_scriptfile_option = None
189 linker_script_option = None
190 linker_nostart_option = None
191 linker_libs_option = None
192 linker_paths_option = None
193
194 linker_newlib_nano_option = None
195
196 for tool in tools:
197
198 if tool.get('id').find('compile') != 1:
199 options = tool.findall('option')
200 # find all compile options
201 for option in options:
202 option_id = option.get('id')
203 if ('compiler.include.paths' in option_id) or ('compiler.option.includepaths' in option_id) or ('compiler.tasking.include' in option_id):
204 compile_include_paths_options += [option]
205 elif option.get('id').find('compiler.include.files') != -1 or option.get('id').find('compiler.option.includefiles') != -1 :
206 compile_include_files_options += [option]
207 elif option.get('id').find('compiler.defs') != -1 or option.get('id').find('compiler.option.definedsymbols') != -1:
208 compile_defs_options += [option]
209
210 if tool.get('id').find('linker') != -1:
211 options = tool.findall('option')
212 # find all linker options
213 for option in options:
214 # the project type and option type must equal
215 if is_cpp_prj != (option.get('id').find('cpp.linker') != -1):
216 continue
217
218 if option.get('id').find('linker.scriptfile') != -1:
219 linker_scriptfile_option = option
220 elif option.get('id').find('linker.option.script') != -1:
221 linker_script_option = option
222 elif option.get('id').find('linker.nostart') != -1:
223 linker_nostart_option = option
224 elif option.get('id').find('linker.libs') != -1:
225 linker_libs_option = option
226 elif option.get('id').find('linker.paths') != -1 and 'LIBPATH' in env:
227 linker_paths_option = option
228 elif option.get('id').find('linker.usenewlibnano') != -1:
229 linker_newlib_nano_option = option
230
231 # change the inclue path
232 for option in compile_include_paths_options:
233 # find all of paths in this project
234 include_paths = option.findall('listOptionValue')
235 for item in include_paths:

Callers 1

UpdateCprojectFunction · 0.85

Calls 10

IsCppProjectFunction · 0.85
RelativeProjectPathFunction · 0.85
IsRttEclipsePathFormatFunction · 0.85
IsRttEclipseLibFormatFunction · 0.85
openFunction · 0.50
setFunction · 0.50
getMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected