Skip to content

Commit a128f77

Browse files
amysparklu-zero
authored andcommitted
Allow debug symbols install to be skipped if they are not present
See AOMediaCodec/libavif#2228 (comment)
1 parent 81f06f3 commit a128f77

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/install.rs

+15-9
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,21 @@ pub fn cinstall(ws: &Workspace, packages: &[CPackage]) -> anyhow::Result<()> {
270270
}
271271

272272
if let Some(ref debug_info) = build_targets.debug_info {
273-
ws.gctx()
274-
.shell()
275-
.status("Installing", "debugging information")?;
276-
let destination_path = build_targets
277-
.debug_info_file_name(&install_path_bin, &install_path_lib)
278-
.unwrap();
279-
280-
create_dir_all(destination_path.parent().unwrap())?;
281-
copy(debug_info, destination_path)?;
273+
if debug_info.exists() {
274+
ws.gctx()
275+
.shell()
276+
.status("Installing", "debugging information")?;
277+
let destination_path = build_targets
278+
.debug_info_file_name(&install_path_bin, &install_path_lib)
279+
.unwrap();
280+
281+
create_dir_all(destination_path.parent().unwrap())?;
282+
copy(debug_info, destination_path)?;
283+
} else {
284+
ws.gctx()
285+
.shell()
286+
.status("Absent", "debugging information")?;
287+
}
282288
}
283289
}
284290

0 commit comments

Comments
 (0)