From 0b00ce41532a613360465f80e96e837ff6e02a60 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 11 Jul 2024 11:03:05 -0700 Subject: [PATCH 1/2] Split binaries into `rav1d_cli` package --- Cargo.lock | 9 +++++++++ Cargo.toml | 14 ++------------ tools/Cargo.toml | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 tools/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index 87e34bc08..856a24d71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,6 +155,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "rav1d_cli" +version = "0.2.0" +dependencies = [ + "cfg-if", + "libc", + "rav1d", +] + [[package]] name = "raw-cpuid" version = "11.0.1" diff --git a/Cargo.toml b/Cargo.toml index 0b6e5bca0..25d50ccec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] -members = [] +members = [".", "tools"] +default-members = [".", "tools"] [package] name = "rav1d" @@ -7,22 +8,11 @@ authors = ["C2Rust"] version = "0.2.0" publish = false edition = "2021" -autobins = false -autotests = false -default-run = "dav1d" [lib] path = "lib.rs" crate-type = ["staticlib", "rlib"] -[[bin]] -path = "tools/dav1d.rs" -name = "dav1d" - -[[bin]] -path = "tests/seek_stress.rs" -name = "seek_stress" - [dependencies] assert_matches = "1.5.0" atomig = { version = "0.4.0", features = ["derive"] } diff --git a/tools/Cargo.toml b/tools/Cargo.toml new file mode 100644 index 000000000..f088b5ead --- /dev/null +++ b/tools/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "rav1d_cli" +authors = ["C2Rust"] +version = "0.2.0" +publish = false +edition = "2021" +default-run = "dav1d" + +[[bin]] +path = "dav1d.rs" +name = "dav1d" + +[[bin]] +path = "../tests/seek_stress.rs" +name = "seek_stress" + +[dependencies] +cfg-if = "1.0.0" +libc = "0.2" +rav1d = { path = "../", version = "0.2.0" } From fb7227f6b9e4bd52814551309fe1d338a89bcd1f Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 11 Jul 2024 11:05:16 -0700 Subject: [PATCH 2/2] Move `seek_stress` into tools --- tools/Cargo.toml | 2 +- {tests => tools}/seek_stress.rs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) rename {tests => tools}/seek_stress.rs (99%) diff --git a/tools/Cargo.toml b/tools/Cargo.toml index f088b5ead..484fc54f3 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -11,7 +11,7 @@ path = "dav1d.rs" name = "dav1d" [[bin]] -path = "../tests/seek_stress.rs" +path = "seek_stress.rs" name = "seek_stress" [dependencies] diff --git a/tests/seek_stress.rs b/tools/seek_stress.rs similarity index 99% rename from tests/seek_stress.rs rename to tools/seek_stress.rs index 3dfb3c08d..e664aa779 100644 --- a/tests/seek_stress.rs +++ b/tools/seek_stress.rs @@ -1,19 +1,16 @@ #![allow(non_upper_case_globals)] #![allow(clippy::all)] -#[path = "../tools/compat"] mod compat { pub mod errno; pub mod stdio; } // mod compat -#[path = "../tools/input"] mod input { mod annexb; pub mod input; mod ivf; mod section5; } // mod input -#[path = "../tools/output"] mod output { mod md5; mod null; @@ -21,7 +18,6 @@ mod output { mod y4m2; mod yuv; } // mod output -#[path = "../tools/dav1d_cli_parse.rs"] mod dav1d_cli_parse; use crate::compat::stdio::stderr;