diff --git a/configure.py b/configure.py index 9f2bf8d1..86398404 100644 --- a/configure.py +++ b/configure.py @@ -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" @@ -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 diff --git a/tools/project.py b/tools/project.py index 3066ebe7..639f5a13 100644 --- a/tools/project.py +++ b/tools/project.py @@ -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: @@ -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']}") @@ -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