Skip to content

Commit 5c4acd6

Browse files
committed
Split CLI into its own crate
- This allows using the library without depending on the getopts and vergen trees
1 parent 3d61bc5 commit 5c4acd6

File tree

9 files changed

+496
-413
lines changed

9 files changed

+496
-413
lines changed

Cargo.toml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repository = "https://github.com/hlorenzi/customasm"
99
readme = "README.md"
1010
license = "Apache-2.0"
1111
keywords = ["asm", "assembler", "assembly", "custom"]
12-
categories = ["command-line-utilities", "hardware-support"]
12+
categories = ["hardware-support"]
1313
exclude = ["web/*"]
1414
build = "src/build.rs"
1515

@@ -18,18 +18,15 @@ crate-type = ["lib", "cdylib"]
1818
name = "customasm"
1919
path = "src/lib.rs"
2020

21-
[[bin]]
22-
name = "customasm"
23-
path = "src/main.rs"
24-
2521
[dependencies]
26-
getopts = "0.2.17"
2722
num-bigint = { version = "0.1", default_features = false }
2823
num-traits = { version = "0.1", default_features = false }
2924
num-integer = { version = "0.1", default_features = false }
3025

3126
[dev-dependencies]
3227
sha2 = "0.9.1"
3328

34-
[build-dependencies]
35-
vergen = "3.1.0"
29+
[workspace]
30+
members = [
31+
"customasm-cli",
32+
]

customasm-cli/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[package]
2+
name = "customasm-cli"
3+
version = "0.11.10"
4+
edition = "2018"
5+
authors = ["hlorenzi <https://hlorenzi.com>"]
6+
description = "An assembler for custom, user-defined instruction sets!"
7+
homepage = "https://github.com/hlorenzi/customasm"
8+
repository = "https://github.com/hlorenzi/customasm"
9+
license = "Apache-2.0"
10+
keywords = ["asm", "assembler", "assembly", "custom"]
11+
categories = ["command-line-utilities", "hardware-support"]
12+
13+
[dependencies]
14+
customasm = { path = "../" }
15+
getopts = "0.2.17"
16+
17+
[build-dependencies]
18+
vergen = "3.1.0"

customasm-cli/build.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extern crate vergen;
2+
3+
4+
use vergen::{generate_cargo_keys, ConstantsFlags};
5+
6+
7+
fn main()
8+
{
9+
let mut flags = ConstantsFlags::empty();
10+
flags.toggle(ConstantsFlags::REBUILD_ON_HEAD_CHANGE);
11+
flags.toggle(ConstantsFlags::SEMVER_LIGHTWEIGHT);
12+
flags.toggle(ConstantsFlags::COMMIT_DATE);
13+
flags.toggle(ConstantsFlags::TARGET_TRIPLE);
14+
15+
generate_cargo_keys(flags).expect("Unable to generate the cargo keys!");
16+
}

0 commit comments

Comments
 (0)