Skip to content

Commit

Permalink
Update dtk-template
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Sep 6, 2024
1 parent 45825ef commit 22e4c67
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
3 changes: 1 addition & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
# Tool versions
config.binutils_tag = "2.42-1"
config.compilers_tag = "20240706"
config.dtk_tag = "v0.9.2"
config.dtk_tag = "v0.9.5"
config.objdiff_tag = "v2.0.0-beta.5"
config.sjiswrap_tag = "v1.1.1"
config.wibo_tag = "0.6.11"
Expand All @@ -154,7 +154,6 @@
config.ldflags = [
"-fp hardware",
"-nodefaults",
"-warn off", # Ignore '.note.split' warnings
# "-listclosure", # Uncomment for Wii linkers
]
# Use for any additional files that should cause a re-configure when modified
Expand Down
42 changes: 28 additions & 14 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,14 +1236,19 @@ def add_unit(
"target_path": obj_path,
"metadata": {
"auto_generated": build_obj["autogenerated"],
"progress_categories": progress_categories,
},
}

obj = objects.get(obj_name)
if obj is None or not obj.src_path or not obj.src_path.exists():
if obj is None:
objdiff_config["units"].append(unit_config)
return

src_exists = obj.src_path is not None and obj.src_path.exists()
if src_exists:
unit_config["base_path"] = obj.src_obj_path

cflags = obj.options["cflags"]
reverse_fn_order = False
if type(cflags) is list:
Expand All @@ -1263,12 +1268,14 @@ def keep_flag(flag):
cflags = list(filter(keep_flag, cflags))

# Add appropriate lang flag
if obj.src_path.suffix in (".cp", ".cpp"):
cflags.insert(0, "-lang=c++")
else:
cflags.insert(0, "-lang=c")
if obj.src_path is not None and not any(
flag.startswith("-lang") for flag in cflags
):
if obj.src_path.suffix in (".cp", ".cpp"):
cflags.insert(0, "-lang=c++")
else:
cflags.insert(0, "-lang=c")

unit_config["base_path"] = obj.src_obj_path
compiler_version = COMPILER_MAP.get(obj.options["mw_version"])
if compiler_version is None:
print(f"Missing scratch compiler mapping for {obj.options['mw_version']}")
Expand All @@ -1281,20 +1288,27 @@ def keep_flag(flag):
"platform": "gc_wii",
"compiler": compiler_version,
"c_flags": cflags_str,
"ctx_path": obj.ctx_path,
"build_ctx": True,
}
if src_exists:
unit_config["scratch"].update(
{
"ctx_path": obj.ctx_path,
"build_ctx": True,
}
)
category_opt: List[str] | str = obj.options["progress_category"]
if isinstance(category_opt, list):
progress_categories.extend(category_opt)
elif category_opt is not None:
progress_categories.append(category_opt)
unit_config["metadata"].update({
"complete": obj.completed,
"reverse_fn_order": reverse_fn_order,
"source_path": obj.src_path,
"progress_categories": progress_categories,
})
unit_config["metadata"].update(
{
"complete": obj.completed,
"reverse_fn_order": reverse_fn_order,
"source_path": obj.src_path,
"progress_categories": progress_categories,
}
)
objdiff_config["units"].append(unit_config)

# Add DOL units
Expand Down

0 comments on commit 22e4c67

Please sign in to comment.