Skip to content

Commit

Permalink
Fix set usage
Browse files Browse the repository at this point in the history
  • Loading branch information
gerioldman committed Oct 10, 2023
1 parent fd1e3af commit 1fac4a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def generate_compdb(self):
rules += [f"{rule}{ext}" for rule in [self.compiler_to_pch_rule_name(compiler)]
for ext in ['', '_RSP']]
# Add custom MIL link rules to get the files compiled by the TASKING compiler family to MIL files included in the database
if compiler.get_id() in set('cctc', 'ccarm', 'cc51', 'ccmsc', 'ccpcp'):
if compiler.get_id() in set(('cctc', 'ccarm', 'cc51', 'ccmsc', 'ccpcp')):
rules += [f"{rule}{ext}" for rule in [self.get_compiler_rule_name('tasking_mil_compile', compiler.for_machine)]
for ext in ['', '_RSP']]
compdb_options = ['-x'] if mesonlib.version_compare(self.ninja_version, '>=1.9') else []
Expand Down Expand Up @@ -1058,9 +1058,11 @@ def generate_target(self, target):
if isinstance(target, build.StaticLibrary):
if target.prelink:
final_obj_list = self.generate_prelink(target, obj_list)
elif linker.id in set('artc', 'ararm', 'ar51', 'armcs', 'arpcp'):
elif linker.id in set(('artc', 'ararm', 'ar51', 'armcs', 'arpcp')):
if target.get_option(OptionKey('b_tasking_mil_link')):
final_obj_list = self.generate_mil_link(target, obj_list)
else:
final_obj_list = obj_list
else:
final_obj_list = obj_list
else:
Expand Down Expand Up @@ -2625,7 +2627,7 @@ def generate_compile_rules(self):
for langname, compiler in clist.items():
if compiler.get_id() == 'clang':
self.generate_llvm_ir_compile_rule(compiler)
if compiler.get_id() == 'cctc' or compiler.get_id() == 'ccarm' or compiler.get_id() == 'cc51' or compiler.get_id() == 'ccmsc' or compiler.get_id() == 'ccpcp':
if compiler.get_id() in set(('cctc', 'ccarm', 'cc51', 'ccmsc', 'ccpcp')):
self.generate_tasking_mil_compile_rules(compiler)
self.generate_tasking_mil_link_rules(compiler)
self.generate_compile_rule_for(langname, compiler)
Expand Down Expand Up @@ -3065,7 +3067,7 @@ def generate_single_compile(self, target: build.BuildTarget, src,
raise InvalidArguments(f'Invalid source type: {src!r}')
obj_basename = self.object_filename_from_source(target, src)
# If mil linking is enabled for the target, then compilation output has to be MIL files instead of object files
if compiler.get_id() == 'cctc' or compiler.get_id() == 'ccarm' or compiler.get_id() == 'cc51' or compiler.get_id() == 'ccmsc' or compiler.get_id() == 'ccpcp':
if compiler.get_id() in set(('cctc', 'ccarm', 'cc51', 'ccmsc', 'ccpcp')):
if target.get_option(OptionKey('b_tasking_mil_link')) and src.endswith('.c'):
if obj_basename.endswith('.o'):
obj_basename = obj_basename[:-1] + 'mil'
Expand Down Expand Up @@ -3094,7 +3096,7 @@ def generate_single_compile(self, target: build.BuildTarget, src,
# If TASKING compiler family is used and MIL linking is enabled for the target,
# then compilation rule name is a special one to output MIL files
# instead of object files for .c files
if compiler.get_id() == 'cctc' or compiler.get_id() == 'ccarm' or compiler.get_id() == 'cc51' or compiler.get_id() == 'ccmsc' or compiler.get_id() == 'ccpcp':
if compiler.get_id() in set(('cctc', 'ccarm', 'cc51', 'ccmsc', 'ccpcp')):
if target.get_option(OptionKey('b_tasking_mil_link')) and src.endswith('.c'):
compiler_name = self.get_compiler_rule_name('tasking_mil_compile', compiler.for_machine)
else:
Expand Down

0 comments on commit 1fac4a9

Please sign in to comment.