MCPcopy Create free account
hub / github.com/doldecomp/mkdd / asm_build

Function asm_build

tools/project.py:1096–1127  ·  view source on GitHub ↗
(
            obj: Object, src_path: Path, obj_path: Optional[Path]
        )

Source from the content-addressed store, hash-verified

1094 return obj.src_obj_path
1095
1096 def asm_build(
1097 obj: Object, src_path: Path, obj_path: Optional[Path]
1098 ) -> Optional[Path]:
1099 if obj.options["asflags"] is None:
1100 sys.exit("ProjectConfig.asflags missing")
1101 asflags_str = make_flags_str(obj.options["asflags"])
1102 if len(obj.options["extra_asflags"]) > 0:
1103 extra_asflags_str = make_flags_str(obj.options["extra_asflags"])
1104 asflags_str += " " + extra_asflags_str
1105
1106 # Avoid creating duplicate build rules
1107 if obj_path is None or obj_path in source_added:
1108 return obj_path
1109 source_added.add(obj_path)
1110
1111 # Add assembler build rule
1112 lib_name = obj.options["lib"]
1113 n.comment(f"{obj.name}: {lib_name} (linked {obj.completed})")
1114 n.build(
1115 outputs=obj_path,
1116 rule="as",
1117 inputs=src_path,
1118 variables={"asflags": asflags_str},
1119 implicit=gnu_as_implicit,
1120 order_only="pre-compile",
1121 )
1122 n.newline()
1123
1124 if obj.options["add_to_all"]:
1125 source_inputs.append(obj_path)
1126
1127 return obj_path
1128
1129 def add_unit(build_obj: BuildConfigUnit, link_step: LinkStep):
1130 obj_path, obj_name = build_obj["object"], build_obj["name"]

Callers 1

add_unitFunction · 0.85

Calls 6

make_flags_strFunction · 0.85
commentMethod · 0.80
buildMethod · 0.80
newlineMethod · 0.80
addMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected