diff --git a/configure.py b/configure.py index 47568a55..931adc5c 100644 --- a/configure.py +++ b/configure.py @@ -4988,8 +4988,29 @@ config.libs = [ Object(Matching, "data/model/int_yos_wheel.c",), ], ), + # custom TUs to be injected into foresta.rel (for modding). + # anything added here should also go into config.add_objects[1]. + # example: + # under 'game_custom' lib: Object(Matching, "src/path/to/my/custom/c_file.c"), + # under config.add_obejcts[1]: ""src/path/to/my/custom/c_file.c"" + { + "lib": "game_custom", + "cflags": cflags_foresta, + "objects": [ + # Object(Matching, "src/path/to/my/custom/c_file.c"), + ], + }, ] +config.add_objects = { + # module_id => object names + # module_id 0 is DOL + # module_id 1 is foresta.rel + 1: [ + # "src/path/to/my/custom/c_file.c", + ], +} + # Define our custom asset processing scripts config.custom_build_rules = [ { diff --git a/tools/project.py b/tools/project.py index d5d5652d..702639fe 100644 --- a/tools/project.py +++ b/tools/project.py @@ -1107,6 +1107,10 @@ def generate_build_ninja( }, module_link_step, ) + # Add custom TUs into the REL + if config.non_matching: + for unit_name in config.add_objects.get(module["module_id"], []): + add_unit({"object": None, "name": unit_name, "autogenerated": False}, module_link_step) link_steps.append(module_link_step) n.newline()