diff options
| author | Man, Jianting (Meco) <[email protected]> | 2021-08-17 16:56:10 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-17 16:56:10 -0500 |
| commit | 3e6578916f892e4456d9dff4bbd44590a0cb4bc8 (patch) | |
| tree | b98d9fe601ce62e17b37f5b971f0cc9f965fa0e3 /tools/eclipse.py | |
| parent | 37a9231e6219b94f7cde8bdea9251e260c4bed18 (diff) | |
| parent | 196f340e5d845efd005b57a2089e0642266a79be (diff) | |
Merge branch 'master' into security
Diffstat (limited to 'tools/eclipse.py')
| -rw-r--r-- | tools/eclipse.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/eclipse.py b/tools/eclipse.py index 4f3cda92b8..6498c1c9f6 100644 --- a/tools/eclipse.py +++ b/tools/eclipse.py @@ -188,7 +188,8 @@ def HandleToolOption(tools, env, project, reset): options = tool.findall('option') # find all compile options for option in options: - if option.get('id').find('compiler.include.paths') != -1 or option.get('id').find('compiler.option.includepaths') != -1: + option_id = option.get('id') + if ('compiler.include.paths' in option_id) or ('compiler.option.includepaths' in option_id) or ('compiler.tasking.include' in option_id): compile_include_paths_options += [option] elif option.get('id').find('compiler.include.files') != -1 or option.get('id').find('compiler.option.includefiles') != -1 : compile_include_files_options += [option] @@ -211,7 +212,7 @@ def HandleToolOption(tools, env, project, reset): linker_nostart_option = option elif option.get('id').find('linker.libs') != -1: linker_libs_option = option - elif option.get('id').find('linker.paths') != -1 and env.has_key('LIBPATH'): + elif option.get('id').find('linker.paths') != -1 and 'LIBPATH' in env: linker_paths_option = option elif option.get('id').find('linker.usenewlibnano') != -1: linker_newlib_nano_option = option @@ -316,7 +317,7 @@ def HandleToolOption(tools, env, project, reset): option.remove(item) # add new libs - if env.has_key('LIBS'): + if 'LIBS' in env: for lib in env['LIBS']: formatedLib = ConverToRttEclipseLibFormat(lib) SubElement(option, 'listOptionValue', { @@ -448,8 +449,10 @@ def RelativeProjectPath(env, path): def HandleExcludingOption(entry, sourceEntries, excluding): old_excluding = [] if entry != None: - old_excluding = entry.get('excluding').split('|') - sourceEntries.remove(entry) + exclud = entry.get('excluding') + if exclud != None: + old_excluding = entry.get('excluding').split('|') + sourceEntries.remove(entry) value = '' for item in old_excluding: @@ -484,8 +487,9 @@ def UpdateCproject(env, project, excluding, reset, prj_name): HandleToolOption(tools, env, project, reset) sourceEntries = cconfiguration.find('storageModule/configuration/sourceEntries') - entry = sourceEntries.find('entry') - HandleExcludingOption(entry, sourceEntries, excluding) + if sourceEntries != None: + entry = sourceEntries.find('entry') + HandleExcludingOption(entry, sourceEntries, excluding) # update refreshScope if prj_name: prj_name = '/' + prj_name |
