Skip to content

Commit 9c68155

Browse files
committed
Write ldscript_template path to ouput depfile
1 parent 5505120 commit 9c68155

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "decomp-toolkit"
33
description = "Yet another GameCube/Wii decompilation toolkit."
44
authors = ["Luke Street <[email protected]>"]
55
license = "MIT OR Apache-2.0"
6-
version = "1.5.1"
6+
version = "1.5.2"
77
edition = "2021"
88
publish = false
99
repository = "https://github.com/encounter/decomp-toolkit"

src/cmd/dol.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ struct ModuleInfo<'a> {
578578
config: &'a ModuleConfig,
579579
symbols_cache: Option<FileReadInfo>,
580580
splits_cache: Option<FileReadInfo>,
581+
dep: Vec<Utf8NativePathBuf>,
581582
}
582583

583584
type ModuleMapByName<'a> = BTreeMap<String, ModuleInfo<'a>>;
@@ -1055,9 +1056,11 @@ fn split_write_obj(
10551056
// Generate ldscript.lcf
10561057
let ldscript_template = if let Some(template_path) = &module.config.ldscript_template {
10571058
let template_path = template_path.with_encoding();
1058-
Some(fs::read_to_string(&template_path).with_context(|| {
1059+
let template = fs::read_to_string(&template_path).with_context(|| {
10591060
format!("Failed to read linker script template '{}'", template_path)
1060-
})?)
1061+
})?;
1062+
module.dep.push(template_path);
1063+
Some(template)
10611064
} else {
10621065
None
10631066
};
@@ -1245,6 +1248,7 @@ fn split(args: SplitArgs) -> Result<()> {
12451248
config: &config.base,
12461249
symbols_cache: result.symbols_cache,
12471250
splits_cache: result.splits_cache,
1251+
dep: Default::default(),
12481252
}
12491253
};
12501254
let mut function_count = dol.obj.symbols.by_kind(ObjSymbolKind::Function).count();
@@ -1259,6 +1263,7 @@ fn split(args: SplitArgs) -> Result<()> {
12591263
config: &config.modules[idx],
12601264
symbols_cache: result.symbols_cache,
12611265
splits_cache: result.splits_cache,
1266+
dep: Default::default(),
12621267
}),
12631268
Entry::Occupied(_) => bail!("Duplicate module name {}", result.obj.name),
12641269
};
@@ -1440,6 +1445,10 @@ fn split(args: SplitArgs) -> Result<()> {
14401445
}
14411446

14421447
// Write dep file
1448+
dep.extend(dol.dep);
1449+
for module in modules.into_values() {
1450+
dep.extend(module.dep);
1451+
}
14431452
{
14441453
let dep_path = args.out_dir.join("dep");
14451454
let mut dep_file = buf_writer(&dep_path)?;

0 commit comments

Comments
 (0)