From 79c33a0c680aec294748faafba2fe27a47ce699e Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Wed, 30 Aug 2023 22:52:52 -0700 Subject: [PATCH] Fix copy_assets and make_manifest - These need the original target_name, not cargo's modified package_name --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index fcd0c36..0b42fc0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -676,7 +676,7 @@ impl Build { .and_then(|target| target.metadata.as_ref()) .and_then(|metadata| metadata.name.clone()) .unwrap_or(to_title_case(&target_name)); - let target_name = target_name.replace('-', "_"); + let package_name = target_name.replace('-', "_"); let source_path = self.make_source_dir(&overall_target_dir, &game_title)?; let dest_path = overall_target_dir.join(format!("{}.pdx", &game_title)); if dest_path.exists() { @@ -688,8 +688,8 @@ impl Build { target_dir = target_dir.join("thumbv7em-none-eabihf").join(dir_name); let lib_file = target_dir.join(format!("{}lib{}.a", target_path, target_name)); self.compile_setup(&target_dir)?; - self.link_binary(&target_dir, &target_name, &lib_file)?; - self.make_binary(&target_dir, &target_name, &source_path)?; + self.link_binary(&target_dir, &package_name, &lib_file)?; + self.make_binary(&target_dir, &package_name, &source_path)?; self.copy_assets(&target_name, &project_path, &crank_manifest, &source_path)?; self.make_manifest(&crank_manifest, &target_name, &source_path)?; self.run_pdc(&source_path, &dest_path)?; @@ -698,7 +698,7 @@ impl Build { } } else { target_dir = target_dir.join(dir_name).join(target_path); - self.link_dylib(&target_dir, &target_name, &source_path)?; + self.link_dylib(&target_dir, &package_name, &source_path)?; self.copy_assets(&target_name, &project_path, &crank_manifest, &source_path)?; self.make_manifest(&crank_manifest, &target_name, &source_path)?; self.run_pdc(&source_path, &dest_path)?;