mirror of
https://github.com/encounter/decomp-toolkit.git
synced 2025-07-16 10:06:08 +00:00
Check for conflicting splits with different file extensions
Resolves #81
This commit is contained in:
parent
0c6eff42cf
commit
93000b28bd
@ -971,9 +971,19 @@ fn split_write_obj(
|
|||||||
entry,
|
entry,
|
||||||
extract: Vec::with_capacity(module.config.extract.len()),
|
extract: Vec::with_capacity(module.config.extract.len()),
|
||||||
};
|
};
|
||||||
|
let mut object_paths = BTreeMap::new();
|
||||||
for (unit, split_obj) in module.obj.link_order.iter().zip(&split_objs) {
|
for (unit, split_obj) in module.obj.link_order.iter().zip(&split_objs) {
|
||||||
let out_obj = write_elf(split_obj, config.export_all)?;
|
let out_obj = write_elf(split_obj, config.export_all)?;
|
||||||
let out_path = obj_dir.join(obj_path_for_unit(&unit.name));
|
let obj_path = obj_path_for_unit(&unit.name);
|
||||||
|
let out_path = obj_dir.join(&obj_path);
|
||||||
|
if let Some(existing) = object_paths.insert(obj_path, unit) {
|
||||||
|
bail!(
|
||||||
|
"Duplicate object path: {} and {} both resolve to {}",
|
||||||
|
existing.name,
|
||||||
|
unit.name,
|
||||||
|
out_path,
|
||||||
|
);
|
||||||
|
}
|
||||||
out_config.units.push(OutputUnit {
|
out_config.units.push(OutputUnit {
|
||||||
object: out_path.with_unix_encoding(),
|
object: out_path.with_unix_encoding(),
|
||||||
name: unit.name.clone(),
|
name: unit.name.clone(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user